drm: Don't implement empty prepare_fb()/cleanup_fb()
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 19 Aug 2016 08:39:29 +0000 (11:39 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Aug 2016 08:58:55 +0000 (10:58 +0200)
The plane .prepare_fb() and .cleanup_fb() helpers are optional, there's
no need to implement empty stubs, and no need to explicitly set the
function pointers to NULL either.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[danvet: Resolved conflicts with Chris' patch.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/arc/arcpgu_crtc.c
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/vc4/vc4_plane.c

index ee0a61c2861b5a33a56c09627db566eb7b1c6a8a..7130b044b004a87cab8af76c0a798c3bcb4e0c0e 100644 (file)
@@ -183,8 +183,6 @@ static void arc_pgu_plane_atomic_update(struct drm_plane *plane,
 }
 
 static const struct drm_plane_helper_funcs arc_pgu_plane_helper_funcs = {
-       .prepare_fb = NULL,
-       .cleanup_fb = NULL,
        .atomic_update = arc_pgu_plane_atomic_update,
 };
 
index 2a3e92976700c49e10412db30903ac94c285d6b3..a7e5486bd1e934be88374df0ce08731f6286ee1a 100644 (file)
@@ -169,25 +169,10 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane,
        return;
 }
 
-static void
-fsl_dcu_drm_plane_cleanup_fb(struct drm_plane *plane,
-                            struct drm_plane_state *new_state)
-{
-}
-
-static int
-fsl_dcu_drm_plane_prepare_fb(struct drm_plane *plane,
-                            struct drm_plane_state *new_state)
-{
-       return 0;
-}
-
 static const struct drm_plane_helper_funcs fsl_dcu_drm_plane_helper_funcs = {
        .atomic_check = fsl_dcu_drm_plane_atomic_check,
        .atomic_disable = fsl_dcu_drm_plane_atomic_disable,
        .atomic_update = fsl_dcu_drm_plane_atomic_update,
-       .cleanup_fb = fsl_dcu_drm_plane_cleanup_fb,
-       .prepare_fb = fsl_dcu_drm_plane_prepare_fb,
 };
 
 static void fsl_dcu_drm_plane_destroy(struct drm_plane *plane)
index 943f708a9dd1e412e5ed0f212d5b7b4815664a06..7e7a4d43d6b698f2326e0e8d2765b0c27bb80164 100644 (file)
@@ -817,19 +817,6 @@ static void ade_disable_channel(struct ade_plane *aplane)
        ade_compositor_routing_disable(base, ch);
 }
 
-static int ade_plane_prepare_fb(struct drm_plane *plane,
-                               struct drm_plane_state *new_state)
-{
-       /* do nothing */
-       return 0;
-}
-
-static void ade_plane_cleanup_fb(struct drm_plane *plane,
-                                struct drm_plane_state *old_state)
-{
-       /* do nothing */
-}
-
 static int ade_plane_atomic_check(struct drm_plane *plane,
                                  struct drm_plane_state *state)
 {
@@ -897,8 +884,6 @@ static void ade_plane_atomic_disable(struct drm_plane *plane,
 }
 
 static const struct drm_plane_helper_funcs ade_plane_helper_funcs = {
-       .prepare_fb = ade_plane_prepare_fb,
-       .cleanup_fb = ade_plane_cleanup_fb,
        .atomic_check = ade_plane_atomic_check,
        .atomic_update = ade_plane_atomic_update,
        .atomic_disable = ade_plane_atomic_disable,
index a02730f908615fac245c62aee326d61e5b94302d..3de7ce33d3d4409a4b85c2f309fa01ebd3f602dd 100644 (file)
@@ -480,17 +480,6 @@ static const struct drm_plane_funcs tegra_primary_plane_funcs = {
        .atomic_destroy_state = tegra_plane_atomic_destroy_state,
 };
 
-static int tegra_plane_prepare_fb(struct drm_plane *plane,
-                                 struct drm_plane_state *new_state)
-{
-       return 0;
-}
-
-static void tegra_plane_cleanup_fb(struct drm_plane *plane,
-                                  struct drm_plane_state *old_fb)
-{
-}
-
 static int tegra_plane_state_add(struct tegra_plane *plane,
                                 struct drm_plane_state *state)
 {
@@ -624,8 +613,6 @@ static void tegra_plane_atomic_disable(struct drm_plane *plane,
 }
 
 static const struct drm_plane_helper_funcs tegra_primary_plane_helper_funcs = {
-       .prepare_fb = tegra_plane_prepare_fb,
-       .cleanup_fb = tegra_plane_cleanup_fb,
        .atomic_check = tegra_plane_atomic_check,
        .atomic_update = tegra_plane_atomic_update,
        .atomic_disable = tegra_plane_atomic_disable,
@@ -796,8 +783,6 @@ static const struct drm_plane_funcs tegra_cursor_plane_funcs = {
 };
 
 static const struct drm_plane_helper_funcs tegra_cursor_plane_helper_funcs = {
-       .prepare_fb = tegra_plane_prepare_fb,
-       .cleanup_fb = tegra_plane_cleanup_fb,
        .atomic_check = tegra_cursor_atomic_check,
        .atomic_update = tegra_cursor_atomic_update,
        .atomic_disable = tegra_cursor_atomic_disable,
@@ -866,8 +851,6 @@ static const uint32_t tegra_overlay_plane_formats[] = {
 };
 
 static const struct drm_plane_helper_funcs tegra_overlay_plane_helper_funcs = {
-       .prepare_fb = tegra_plane_prepare_fb,
-       .cleanup_fb = tegra_plane_cleanup_fb,
        .atomic_check = tegra_plane_atomic_check,
        .atomic_update = tegra_plane_atomic_update,
        .atomic_disable = tegra_plane_atomic_disable,
index 29e4b400e25e34a63e4710e9edbba62541b9cdc5..881bf489478b01b34e9e4df6013fe608c42215ee 100644 (file)
@@ -735,8 +735,6 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb)
 }
 
 static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = {
-       .prepare_fb = NULL,
-       .cleanup_fb = NULL,
        .atomic_check = vc4_plane_atomic_check,
        .atomic_update = vc4_plane_atomic_update,
 };