]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/simple-kms-helper: Plumb plane state to the enable hook
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 22 Mar 2018 20:27:37 +0000 (22:27 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 28 Mar 2018 16:19:32 +0000 (19:19 +0300)
tinydrm enable hook wants to play around with the new fb in
.atomic_enable(), thus we'll need access to the plane state.

Performed with coccinelle:
@r1@
identifier F =~ ".*enable$";
identifier P, CS;
@@
F(
struct drm_simple_display_pipe *P
,struct drm_crtc_state *CS
+ ,struct drm_plane_state *plane_state
)
{
...
}

@@
struct drm_simple_display_pipe *P;
expression E;
@@
{
+ struct drm_plane *plane;
...
+ plane = &P->plane;
P->funcs->enable(P
,E
+ ,plane->state
);
...
}

@@
identifier P, CS;
@@
struct drm_simple_display_pipe_funcs {
...
        void (*enable)(struct drm_simple_display_pipe *P
      ,struct drm_crtc_state *CS
+ ,struct drm_plane_state *plane_state
);
...
};

v2: Pimp the commit message (David)

Cc: Marek Vasut <marex@denx.de>
Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322202738.25817-1-ville.syrjala@linux.intel.com
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
drivers/gpu/drm/drm_simple_kms_helper.c
drivers/gpu/drm/mxsfb/mxsfb_drv.c
drivers/gpu/drm/pl111/pl111_display.c
drivers/gpu/drm/tinydrm/ili9225.c
drivers/gpu/drm/tinydrm/mi0283qt.c
drivers/gpu/drm/tinydrm/repaper.c
drivers/gpu/drm/tinydrm/st7586.c
drivers/gpu/drm/tinydrm/st7735r.c
drivers/gpu/drm/tve200/tve200_display.c
include/drm/drm_simple_kms_helper.h

index 987a353c7f720113fe4e07e81d76ba4a581d4394..7a00455ca568b0e82f35f6a6a5d972f26d41b204 100644 (file)
@@ -64,13 +64,15 @@ static int drm_simple_kms_crtc_check(struct drm_crtc *crtc,
 static void drm_simple_kms_crtc_enable(struct drm_crtc *crtc,
                                       struct drm_crtc_state *old_state)
 {
+       struct drm_plane *plane;
        struct drm_simple_display_pipe *pipe;
 
        pipe = container_of(crtc, struct drm_simple_display_pipe, crtc);
        if (!pipe->funcs || !pipe->funcs->enable)
                return;
 
-       pipe->funcs->enable(pipe, crtc->state);
+       plane = &pipe->plane;
+       pipe->funcs->enable(pipe, crtc->state, plane->state);
 }
 
 static void drm_simple_kms_crtc_disable(struct drm_crtc *crtc,
index 5cae8db9dcd48172726aeb7ebe59be5a53e44c52..b9c7507813dbe7971442eca2b4f7ae39eedeafe0 100644 (file)
@@ -99,7 +99,8 @@ static const struct drm_mode_config_funcs mxsfb_mode_config_funcs = {
 };
 
 static void mxsfb_pipe_enable(struct drm_simple_display_pipe *pipe,
-                             struct drm_crtc_state *crtc_state)
+                             struct drm_crtc_state *crtc_state,
+                             struct drm_plane_state *plane_state)
 {
        struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe);
 
index 31064642790718caa9eb7ee71fa1bff8a27f0668..1fee578e05b0586b01bf7bf6402db91c8df0fc6f 100644 (file)
@@ -120,7 +120,8 @@ static int pl111_display_check(struct drm_simple_display_pipe *pipe,
 }
 
 static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
-                                struct drm_crtc_state *cstate)
+                                struct drm_crtc_state *cstate,
+                                struct drm_plane_state *plane_state)
 {
        struct drm_crtc *crtc = &pipe->crtc;
        struct drm_plane *plane = &pipe->plane;
index a0759502b81ac35e8a0a0c4bb44fadda5a4a5543..089d22798c8bbe262ffe80c695660e9cdb8c3a1d 100644 (file)
@@ -176,7 +176,8 @@ static const struct drm_framebuffer_funcs ili9225_fb_funcs = {
 };
 
 static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe,
-                               struct drm_crtc_state *crtc_state)
+                               struct drm_crtc_state *crtc_state,
+                               struct drm_plane_state *plane_state)
 {
        struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
        struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
index d8ed6e6f8e059d50894a19fe49205db3da3d6705..82ad9b61898ed02016a64ae8fce9d093ce9610c5 100644 (file)
@@ -49,7 +49,8 @@
 #define ILI9341_MADCTL_MY      BIT(7)
 
 static void mi0283qt_enable(struct drm_simple_display_pipe *pipe,
-                           struct drm_crtc_state *crtc_state)
+                           struct drm_crtc_state *crtc_state,
+                           struct drm_plane_state *plane_state)
 {
        struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
        struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
index 75740630c410624cc6012228e18ef3507f277180..33b4a71916e47fe46fdd3fb0d1ba4a83567ae256 100644 (file)
@@ -659,7 +659,8 @@ static void power_off(struct repaper_epd *epd)
 }
 
 static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe,
-                               struct drm_crtc_state *crtc_state)
+                               struct drm_crtc_state *crtc_state,
+                               struct drm_plane_state *plane_state)
 {
        struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
        struct repaper_epd *epd = epd_from_tinydrm(tdev);
index a6396ef9cc4ae7d7c58dcd51893f78005b9a022e..bb08b293c8ce5d742435ca346372d9613ba1fe35 100644 (file)
@@ -175,7 +175,8 @@ static const struct drm_framebuffer_funcs st7586_fb_funcs = {
 };
 
 static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,
-                              struct drm_crtc_state *crtc_state)
+                              struct drm_crtc_state *crtc_state,
+                              struct drm_plane_state *plane_state)
 {
        struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
        struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
index 67d197ecfc4b07cf20508a6a3e874e539f68ce2f..19b28f8c78dbe17a5edb8f58c0db387b4c872fa2 100644 (file)
@@ -37,7 +37,8 @@
 #define ST7735R_MV     BIT(5)
 
 static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,
-                                     struct drm_crtc_state *crtc_state)
+                                     struct drm_crtc_state *crtc_state,
+                                     struct drm_plane_state *plane_state)
 {
        struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
        struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
index db397fcb345a5dbafea99998b91367dc3c3c400a..108f3b2b5d25b60f4b80453b732ad73983de02c1 100644 (file)
@@ -120,7 +120,8 @@ static int tve200_display_check(struct drm_simple_display_pipe *pipe,
 }
 
 static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
-                                struct drm_crtc_state *cstate)
+                                struct drm_crtc_state *cstate,
+                                struct drm_plane_state *plane_state)
 {
        struct drm_crtc *crtc = &pipe->crtc;
        struct drm_plane *plane = &pipe->plane;
index 1b4e352143fd70ce54a4e858722bbeac68c7b367..b0279374231791fba9cbf64c1d85756d90d94379 100644 (file)
@@ -64,7 +64,8 @@ struct drm_simple_display_pipe_funcs {
         * This hook is optional.
         */
        void (*enable)(struct drm_simple_display_pipe *pipe,
-                      struct drm_crtc_state *crtc_state);
+                      struct drm_crtc_state *crtc_state,
+                      struct drm_plane_state *plane_state);
        /**
         * @disable:
         *