[Intel-gfx] [PATCH] enforce position to 0 for rotate framebuffer

Li Peng peng.li at linux.intel.com
Wed Jul 8 04:43:38 CEST 2009


>From 7fe6defc7fb78b543655f1758e09d5fd64b510d1 Mon Sep 17 00:00:00 2001
From: Li Peng <peng.li at intel.com>
Date: Wed, 8 Jul 2009 10:28:23 +0800
Subject: enforce position to 0 for rotate framebuffer

In most cases (x, y) is (0, 0) for rotated fb, but if we
do rotation on the second display of extended desktop,
(x, y) may not be (0, 0), which will result in crtc pointing
to the rotated framebuffer with a wrong offset.

It fixes moblin bug (http://bugzilla.moblin.org/show_bug.cgi?id=4015)

Signed-off-by: Li Peng <peng.li at intel.com>
---
 src/drmmode_display.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e9296dc..dba2947 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -220,8 +220,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 
 
 	fb_id = drmmode->fb_id;
-	if (drmmode_crtc->rotate_fb_id)
+	if (drmmode_crtc->rotate_fb_id) {
 		fb_id = drmmode_crtc->rotate_fb_id;
+		x = 0;
+		y = 0;
+	}
 	ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
 			     fb_id, x, y, output_ids, output_count, &kmode);
 	if (ret)
-- 
1.6.1.3






More information about the Intel-gfx mailing list