]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/vc4: crtc: Force trigger of dlist update on margins change
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Fri, 21 Jun 2024 15:20:27 +0000 (16:20 +0100)
committerDave Stevenson <dave.stevenson@raspberrypi.com>
Mon, 9 Sep 2024 12:02:52 +0000 (13:02 +0100)
When the margins are changed, the dlist needs to be regenerated
with the changed updated dest regions for each of the planes.

Setting the zpos_changed flag is sufficient to trigger that
without doing a full modeset, therefore set it should the
margins be changed.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240621152055.4180873-4-dave.stevenson@raspberrypi.com
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.h

index 8b5a7e5eb1466c27604afdbd49b4b67b99e01262..1d54176cf8116a0dabfd4b81fd3e03b9d00e54b3 100644 (file)
@@ -735,10 +735,17 @@ int vc4_crtc_atomic_check(struct drm_crtc *crtc,
                if (conn_state->crtc != crtc)
                        continue;
 
-               vc4_state->margins.left = conn_state->tv.margins.left;
-               vc4_state->margins.right = conn_state->tv.margins.right;
-               vc4_state->margins.top = conn_state->tv.margins.top;
-               vc4_state->margins.bottom = conn_state->tv.margins.bottom;
+               if (memcmp(&vc4_state->margins, &conn_state->tv.margins,
+                          sizeof(vc4_state->margins))) {
+                       memcpy(&vc4_state->margins, &conn_state->tv.margins,
+                              sizeof(vc4_state->margins));
+
+                       /*
+                        * Need to force the dlist entries for all planes to be
+                        * updated so that the dest rectangles are changed.
+                        */
+                       crtc_state->zpos_changed = true;
+               }
                break;
        }
 
index 697e9b7c9d0e61949f5493fd8b26ac75a64052d3..717fd1140561af98ad09109b5bb50799283537ae 100644 (file)
@@ -598,12 +598,7 @@ struct vc4_crtc_state {
        bool txp_armed;
        unsigned int assigned_channel;
 
-       struct {
-               unsigned int left;
-               unsigned int right;
-               unsigned int top;
-               unsigned int bottom;
-       } margins;
+       struct drm_connector_tv_margins margins;
 
        unsigned long hvs_load;