mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			65 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			65 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
From 3c5802ee9bdae3d3fc37b0da8a437cf565ad264a Mon Sep 17 00:00:00 2001
 | 
						|
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
 | 
						|
Date: Fri, 1 Apr 2022 11:31:38 +0100
 | 
						|
Subject: [PATCH 044/726] drm/vc4: Force trigger of dlist update on margins
 | 
						|
 change
 | 
						|
 | 
						|
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.
 | 
						|
 | 
						|
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
 | 
						|
---
 | 
						|
 drivers/gpu/drm/vc4/vc4_crtc.c | 14 ++++++++++----
 | 
						|
 drivers/gpu/drm/vc4/vc4_drv.h  |  7 +------
 | 
						|
 2 files changed, 11 insertions(+), 10 deletions(-)
 | 
						|
 | 
						|
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
 | 
						|
index 0b16fb5acd7d..97b1107a30bb 100644
 | 
						|
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
 | 
						|
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
 | 
						|
@@ -757,10 +757,16 @@ static 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;
 | 
						|
 	}
 | 
						|
 
 | 
						|
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
 | 
						|
index 3be66ba8ecdd..a3d058d3c788 100644
 | 
						|
--- a/drivers/gpu/drm/vc4/vc4_drv.h
 | 
						|
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
 | 
						|
@@ -581,12 +581,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;
 | 
						|
 
 | 
						|
-- 
 | 
						|
2.33.1
 | 
						|
 |