Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/modeset: Handle tiled displays in pan_display_atomic.
@ 2025-01-16 14:28 Maarten Lankhorst
  2025-01-16 14:28 ` [PATCH 2/2] drm/client: Handle tiled displays better Maarten Lankhorst
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Maarten Lankhorst @ 2025-01-16 14:28 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx, intel-xe, Maarten Lankhorst

Tiled displays have a different x/y offset to begin with. Instead of
attempting to remember this, just apply a delta instead.

Hope this works..

Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
 drivers/gpu/drm/drm_fb_helper.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index c9008113111ba..fb3614a7ba44b 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1354,14 +1354,14 @@ int drm_fb_helper_set_par(struct fb_info *info)
 }
 EXPORT_SYMBOL(drm_fb_helper_set_par);
 
-static void pan_set(struct drm_fb_helper *fb_helper, int x, int y)
+static void pan_set(struct drm_fb_helper *fb_helper, int dx, int dy)
 {
 	struct drm_mode_set *mode_set;
 
 	mutex_lock(&fb_helper->client.modeset_mutex);
 	drm_client_for_each_modeset(mode_set, &fb_helper->client) {
-		mode_set->x = x;
-		mode_set->y = y;
+		mode_set->x += dx;
+		mode_set->y += dy;
 	}
 	mutex_unlock(&fb_helper->client.modeset_mutex);
 }
@@ -1370,16 +1370,18 @@ static int pan_display_atomic(struct fb_var_screeninfo *var,
 			      struct fb_info *info)
 {
 	struct drm_fb_helper *fb_helper = info->par;
-	int ret;
+	int ret, dx, dy;
 
-	pan_set(fb_helper, var->xoffset, var->yoffset);
+	dx = var->xoffset - info->var.xoffset;
+	dy = var->yoffset - info->var.yoffset;
+	pan_set(fb_helper, dx, dy);
 
 	ret = drm_client_modeset_commit_locked(&fb_helper->client);
 	if (!ret) {
 		info->var.xoffset = var->xoffset;
 		info->var.yoffset = var->yoffset;
 	} else
-		pan_set(fb_helper, info->var.xoffset, info->var.yoffset);
+		pan_set(fb_helper, -dx, -dy);
 
 	return ret;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-01-20 11:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 14:28 [PATCH 1/2] drm/modeset: Handle tiled displays in pan_display_atomic Maarten Lankhorst
2025-01-16 14:28 ` [PATCH 2/2] drm/client: Handle tiled displays better Maarten Lankhorst
2025-01-20 11:40   ` Thomas Zimmermann
2025-01-16 20:30 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/modeset: Handle tiled displays in pan_display_atomic Patchwork
2025-01-16 20:31 ` ✓ CI.checkpatch: " Patchwork
2025-01-16 20:32 ` ✓ CI.KUnit: " Patchwork
2025-01-16 20:50 ` ✓ CI.Build: " Patchwork
2025-01-16 20:52 ` ✓ CI.Hooks: " Patchwork
2025-01-16 20:54 ` ✓ CI.checksparse: " Patchwork
2025-01-16 21:19 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-17  1:34 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-20 11:39 ` [PATCH 1/2] " Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox