Commit f8bd3dbb authored by Daniel Vetter's avatar Daniel Vetter

drm/vram-helpers: Create DRM_GEM_VRAM_PLANE_HELPER_FUNCS

Like we have for the shadow helpers too, and roll it out to drivers.
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarTian Tao <tiantao6@hisilicon.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Tian Tao <tiantao6@hisilicon.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-11-daniel.vetter@ffwll.ch
parent 1a896130
...@@ -612,8 +612,7 @@ ast_primary_plane_helper_atomic_disable(struct drm_plane *plane, ...@@ -612,8 +612,7 @@ ast_primary_plane_helper_atomic_disable(struct drm_plane *plane,
} }
static const struct drm_plane_helper_funcs ast_primary_plane_helper_funcs = { static const struct drm_plane_helper_funcs ast_primary_plane_helper_funcs = {
.prepare_fb = drm_gem_vram_plane_helper_prepare_fb, DRM_GEM_VRAM_PLANE_HELPER_FUNCS,
.cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb,
.atomic_check = ast_primary_plane_helper_atomic_check, .atomic_check = ast_primary_plane_helper_atomic_check,
.atomic_update = ast_primary_plane_helper_atomic_update, .atomic_update = ast_primary_plane_helper_atomic_update,
.atomic_disable = ast_primary_plane_helper_atomic_disable, .atomic_disable = ast_primary_plane_helper_atomic_disable,
......
...@@ -152,8 +152,7 @@ static const struct drm_plane_funcs hibmc_plane_funcs = { ...@@ -152,8 +152,7 @@ static const struct drm_plane_funcs hibmc_plane_funcs = {
}; };
static const struct drm_plane_helper_funcs hibmc_plane_helper_funcs = { static const struct drm_plane_helper_funcs hibmc_plane_helper_funcs = {
.prepare_fb = drm_gem_vram_plane_helper_prepare_fb, DRM_GEM_VRAM_PLANE_HELPER_FUNCS,
.cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb,
.atomic_check = hibmc_plane_atomic_check, .atomic_check = hibmc_plane_atomic_check,
.atomic_update = hibmc_plane_atomic_update, .atomic_update = hibmc_plane_atomic_update,
}; };
......
...@@ -488,8 +488,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = { ...@@ -488,8 +488,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = {
.atomic_check = vbox_primary_atomic_check, .atomic_check = vbox_primary_atomic_check,
.atomic_update = vbox_primary_atomic_update, .atomic_update = vbox_primary_atomic_update,
.atomic_disable = vbox_primary_atomic_disable, .atomic_disable = vbox_primary_atomic_disable,
.prepare_fb = drm_gem_vram_plane_helper_prepare_fb, DRM_GEM_VRAM_PLANE_HELPER_FUNCS,
.cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb,
}; };
static const struct drm_plane_funcs vbox_primary_plane_funcs = { static const struct drm_plane_funcs vbox_primary_plane_funcs = {
......
...@@ -124,6 +124,18 @@ void ...@@ -124,6 +124,18 @@ void
drm_gem_vram_plane_helper_cleanup_fb(struct drm_plane *plane, drm_gem_vram_plane_helper_cleanup_fb(struct drm_plane *plane,
struct drm_plane_state *old_state); struct drm_plane_state *old_state);
/**
* DRM_GEM_VRAM_PLANE_HELPER_FUNCS -
* Initializes struct drm_plane_helper_funcs for VRAM handling
*
* Drivers may use GEM BOs as VRAM helpers for the framebuffer memory. This
* macro initializes struct drm_plane_helper_funcs to use the respective helper
* functions.
*/
#define DRM_GEM_VRAM_PLANE_HELPER_FUNCS \
.prepare_fb = drm_gem_vram_plane_helper_prepare_fb, \
.cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb
/* /*
* Helpers for struct drm_simple_display_pipe_funcs * Helpers for struct drm_simple_display_pipe_funcs
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment