drm/omapdrm: Set VM flags in GEM-object mmap function
Use the mmap callback in struct drm_gem_object_funcs to set the VM flags. Replace a number of mmap helpers in omapdrm with their GEM helper counterparts. Generate DRM's file-operations instance with GEM's DEFINE_DRM_GEM_FOPS. The omapdrm driver uses DRM's drm_gem_mmap() helper to prepare the VMA structure. It then modifies the resulting VMA state in its own helper omap_gem_mmap_obj(). The patch improves this by setting up the VMA in the mmap callback in drm_gem_object_funcs, which is called from within drm_gem_mmap(). Omapdrm's omap_gem_mmap() and omap_gem_mmap() can then be removed from the driver. A call to drm_gem_mmap() is sufficient for the mmap operation. Finally, with the omap functions gone, the drivers file_ops in omapdriver_fops can be generated with DEFINE_DRM_GEM_FOPS, which sets DRM's default helpers. v2: * detailed commit message (Javier) * do not set VM_PFNMAP Signed-off-by:Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by:
Javier Martinez Canillas <javierm@redhat.com> Acked-by:
Maxime Ripard <mripard@kernel.org> Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-9-tzimmermann@suse.de
Showing
- drivers/gpu/drm/omapdrm/omap_drv.c 1 addition, 11 deletionsdrivers/gpu/drm/omapdrm/omap_drv.c
- drivers/gpu/drm/omapdrm/omap_gem.c 6 additions, 18 deletionsdrivers/gpu/drm/omapdrm/omap_gem.c
- drivers/gpu/drm/omapdrm/omap_gem.h 0 additions, 3 deletionsdrivers/gpu/drm/omapdrm/omap_gem.h
- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c 1 addition, 6 deletionsdrivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
Loading
Please register or sign in to comment