Convert all remaining drivers to GEM object functions
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest22 patches 4 repliesIn review
- v221 patches 25 repliesSuperseded
- v120 patches 16 repliesSuperseded
Changes in v3 from the cover letter
* restore default call to drm_gem_prime_export() in drm_gem_prime_handle_to_fd()
* return -ENOSYS if get_sg_table is not set
* drop all checks for obj->funcs
* clean up TODO list and documentation
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/22 | drm/amdgpu: Introduce GEM object functionsdrivers/ drivers/ drivers/ | +18 | 0 replies | |
| 2/22 | drm/armada: Introduce GEM object functionsdrivers/ drivers/ drivers/ | +11 | 0 replies | |
| 3/22 | drm/etnaviv: Introduce GEM object functionsdrivers/ drivers/ drivers/ | +18 | 1 reply | |
| 4/22 | drm/exynos: Introduce GEM object functionsdrivers/ drivers/ | +15 | 0 replies | |
| 5/22 | drm/gma500: Introduce GEM object functionsdrivers/ drivers/ drivers/ +2 more | +21 | 0 replies | |
| 6/22 | drm/i915: Introduce GEM object functionsdrivers/ drivers/ drivers/ +1 more | +18 | 0 replies | |
| 7/22 | drm/imx/dcss: Initialize DRM driver instance with CMA helper macrodrivers/ | +1 | 1 reply | |
| 8/22 | drm/mediatek: Introduce GEM object functionsdrivers/ drivers/ | +11 | 0 replies | |
| 9/22 | drm/msm: Introduce GEM object funcsdrivers/ drivers/ drivers/ | +18 | 0 replies | |
| 10/22 | drm/nouveau: Introduce GEM object functionsdrivers/ drivers/ drivers/ +1 more | +17 | 0 replies | |
| 11/22 | drm/omapdrm: Introduce GEM object functionsdrivers/ drivers/ drivers/ | +16 | 0 replies | |
| 12/22 | drm/pl111: Introduce GEM object functionsdrivers/ | +1 | 0 replies | |
| 13/22 | drm/radeon: Introduce GEM object functionsdrivers/ drivers/ | +28 | 0 replies | |
| 14/22 | drm/rockchip: Convert to drm_gem_object_funcsdrivers/ drivers/ | +11 | 0 replies | |
| 15/22 | drm/tegra: Introduce GEM object functionsdrivers/ drivers/ | +8 | 0 replies | |
| 16/22 | drm/vc4: Introduce GEM object functionsdrivers/ drivers/ drivers/ | +20 | 0 replies | |
| 17/22 | drm/vgem: Introduce GEM object functionsdrivers/ | +14 | 0 replies | |
| 18/22 | drm/virtgpu: Set PRIME export function in struct drm_gem_object_funcsdrivers/ drivers/ | +1 | 0 replies | |
| 19/22 | drm/vkms: Introduce GEM object functionsdrivers/ drivers/ | +13 | 0 replies | |
| 20/22 | drm/xen: Introduce GEM object functionsdrivers/ drivers/ drivers/ | +34 | 0 replies | |
| 21/22 | drm/xlnx: Initialize DRM driver instance with CMA helper macrodrivers/ | +1 | 0 replies | |
| 22/22 | drm: Remove obsolete GEM and PRIME callbacks from struct drm_driverDocumentation/ Documentation/ drivers/ +4 more | +38 | 0 replies |
Reviews trailers per patch
All 22 patches have a Reviewed-by or Acked-by.
| Patch | Christian König | Russell King | Daniel Vetter | Tvrtko Ursulin | Laurent Pinchart | Tomi Valkeinen | Eric Anholt | Thierry Reding | Melissa Wen | Oleksandr Andrushchenko | Hyun Kwon | Laurentiu Palcu | Lucas Stach |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1/22 | R-b | ||||||||||||
| 2/22 | A-b | ||||||||||||
| 3/22 | R-b | A-b | |||||||||||
| 4/22 | R-b | ||||||||||||
| 5/22 | R-b | ||||||||||||
| 6/22 | R-b | ||||||||||||
| 7/22 | R-b | ||||||||||||
| 8/22 | R-b | ||||||||||||
| 9/22 | R-b | ||||||||||||
| 10/22 | R-b | ||||||||||||
| 11/22 | R-b | R-b | |||||||||||
| 12/22 | R-b | ||||||||||||
| 13/22 | R-b | ||||||||||||
| 14/22 | R-b | ||||||||||||
| 15/22 | A-b | ||||||||||||
| 16/22 | R-b | ||||||||||||
| 17/22 | R-b | ||||||||||||
| 18/22 | R-b | ||||||||||||
| 19/22 | R-b | ||||||||||||
| 20/22 | A-b | ||||||||||||
| 21/22 | R-b | R-b | |||||||||||
| 22/22 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 13 reviewers.
Cover letter [PATCH v3 00/22] Convert all remaining drivers to GEM object functions
The GEM and PRIME related callbacks in struct drm_driver are deprecated in favor of GEM object functions in struct drm_gem_object_funcs. This patchset converts the remaining drivers to object functions and removes most of the obsolete interfaces.
Version 3 of this patchset mostly fixes drm_gem_prime_handle_to_fd and updates i.MX's dcss driver. The driver was missing from earlier versions and still needs review.
Patches #1 to #6, #8 to #17 and #19 to #20 convert DRM drivers to GEM object functions, one by one. Each patch moves existing callbacks from struct drm_driver to an instance of struct drm_gem_object_funcs, and sets these funcs when the GEM object is initialized. The expection is .gem_prime_mmap. There are different ways of how drivers implement the callback, and moving it to GEM object functions requires a closer review for each.
Patch #18 fixes virtgpu to use GEM object functions where possible. The driver recently introduced a function for one of the deprecated callbacks.
Patches #7 and #20 convert i.MX's dcss and xlnx to CMA helper macros. There's no apparent reason why the drivers do the GEM setup on their's own. Using CMA helper macros adds GEM object functions implicitly.
With most of the GEM and PRIME moved to GEM object functions, related code in struct drm_driver and in the DRM core/helpers is being removed by patch #22.
Further testing is welcome. I tested the drivers for which I have HW available. These are gma500, i915, nouveau, radeon and vc4. The console, Weston and Xorg apparently work with the patches applied.
v3:
* restore default call to drm_gem_prime_export() in drm_gem_prime_handle_to_fd()
* return -ENOSYS if get_sg_table is not set
* drop all checks for obj->funcs
* clean up TODO list and documentation
v2:
* moved code in amdgpu and radeon
* made several functions static in various drivers
* updated TODO-list item
* fix virtgpu
Thomas Zimmermann (22):
drm/amdgpu: Introduce GEM object functions
drm/armada: Introduce GEM object functions
drm/etnaviv: Introduce GEM object functions
drm/exynos: Introduce GEM object functions
drm/gma500: Introduce GEM object functions
drm/i915: Introduce GEM object functions
drm/imx/dcss: Initialize DRM driver instance with CMA helper macro drm/mediatek: Introduce GEM object functions
drm/msm: Introduce GEM object funcs
drm/nouveau: Introduce GEM object functions
drm/omapdrm: Introduce GEM object functions
drm/pl111: Introduce GEM object functions
drm/radeon: Introduce GEM object functions
drm/rockchip: Convert to drm_gem_object_funcs
drm/tegra: Introduce GEM object functions
drm/vc4: Introduce GEM object functions
drm/vgem: Introduce GEM object functions
drm/virtgpu: Set PRIME export function in struct drm_gem_object_funcs drm/vkms: Introduce GEM object functions
drm/xen: Introduce GEM object functions
drm/xlnx: Initialize DRM driver instance with CMA helper macro
drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
Documentation/gpu/drm-mm.rst | 4 +- Documentation/gpu/todo.rst | 9 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 -- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 23 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.h | 5 -- drivers/gpu/drm/armada/armada_drv.c | 3 - drivers/gpu/drm/armada/armada_gem.c | 12 ++- drivers/gpu/drm/armada/armada_gem.h | 2 - drivers/gpu/drm/drm_gem.c | 53 ++++-------- drivers/gpu/drm/drm_gem_cma_helper.c | 8 +- drivers/gpu/drm/drm_prime.c | 14 +-- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 13 --- drivers/gpu/drm/etnaviv/etnaviv_drv.h | 1 - drivers/gpu/drm/etnaviv/etnaviv_gem.c | 19 ++++- drivers/gpu/drm/exynos/exynos_drm_drv.c | 10 --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 15 ++++ drivers/gpu/drm/gma500/framebuffer.c | 2 + drivers/gpu/drm/gma500/gem.c | 18 +++- drivers/gpu/drm/gma500/gem.h | 3 + drivers/gpu/drm/gma500/psb_drv.c | 9 -- drivers/gpu/drm/gma500/psb_drv.h | 2 - drivers/gpu/drm/i915/gem/i915_gem_object.c | 21 ++++- drivers/gpu/drm/i915/gem/i915_gem_object.h | 3 - drivers/gpu/drm/i915/i915_drv.c | 4 - .../gpu/drm/i915/selftests/mock_gem_device.c | 3 - drivers/gpu/drm/imx/dcss/dcss-kms.c | 14 +-- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 5 -- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 11 +++ drivers/gpu/drm/msm/msm_drv.c | 13 --- drivers/gpu/drm/msm/msm_drv.h | 1 - drivers/gpu/drm/msm/msm_gem.c | 19 ++++- drivers/gpu/drm/nouveau/nouveau_drm.c | 9 -- drivers/gpu/drm/nouveau/nouveau_gem.c | 13 +++ drivers/gpu/drm/nouveau/nouveau_gem.h | 2 + drivers/gpu/drm/nouveau/nouveau_prime.c | 2 + drivers/gpu/drm/omapdrm/omap_drv.c | 9 -- drivers/gpu/drm/omapdrm/omap_gem.c | 18 +++- drivers/gpu/drm/omapdrm/omap_gem.h | 2 - drivers/gpu/drm/pl111/pl111_drv.c | 5 +- drivers/gpu/drm/radeon/radeon_drv.c | 23 +---- drivers/gpu/drm/radeon/radeon_gem.c | 31 ++++++- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 5 -- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 12 ++- drivers/gpu/drm/tegra/drm.c | 4 - drivers/gpu/drm/tegra/gem.c | 8 ++ drivers/gpu/drm/vc4/vc4_bo.c | 21 ++++- drivers/gpu/drm/vc4/vc4_drv.c | 12 --- drivers/gpu/drm/vc4/vc4_drv.h | 1 - drivers/gpu/drm/vgem/vgem_drv.c | 21 +++-- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 - drivers/gpu/drm/virtio/virtgpu_object.c | 1 + drivers/gpu/drm/vkms/vkms_drv.c | 8 -- drivers/gpu/drm/vkms/vkms_gem.c | 13 +++ drivers/gpu/drm/xen/xen_drm_front.c | 44 ++++------ drivers/gpu/drm/xen/xen_drm_front.h | 2 + drivers/gpu/drm/xen/xen_drm_front_gem.c | 15 ++++ drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 14 +-- include/drm/drm_drv.h | 85 +------------------ include/drm/drm_gem.h | 2 +- 59 files changed, 333 insertions(+), 375 deletions(-)