[PATCH V2] fbdev: initialize yoffset of varinfo

mchalain [marc.chalain@gmail.com] marc.chalain at gmail.com
Fri Jun 21 06:06:29 PDT 2013


From: mchalain <marc.chalain at gmail.com>

 it initializes varinfo.yoffset. varinfo.yoffset has to
 point on the beginning of the video memory.
 The card uses this value to push on the screen a part of
 the video memory when this one is larger than the screen.
---
 weston/src/compositor-fbdev.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/weston/src/compositor-fbdev.c b/weston/src/compositor-fbdev.c
index 9c3d17e..e817072 100644
--- a/weston/src/compositor-fbdev.c
+++ b/weston/src/compositor-fbdev.c
@@ -325,6 +325,11 @@ fbdev_query_screen_info(struct fbdev_output *output, int fd,
 	info->pixel_format = calculate_pixman_format(&varinfo, &fixinfo);
 	info->refresh_rate = calculate_refresh_rate(&varinfo);
 
+	if (varinfo.yoffset != 0) {
+		varinfo.yoffset	= 0;
+		if (ioctl(fd, FBIOPUT_VSCREENINFO, &varinfo) < 0)
+			return -1;
+	}
 	if (info->pixel_format == 0) {
 		weston_log("Frame buffer uses an unsupported format.\n");
 		return -1;
@@ -366,6 +371,7 @@ fbdev_set_screen_info(struct fbdev_output *output, int fd,
 	varinfo.blue.length = 8;
 	varinfo.blue.msb_right = 0;
 
+	varinfo.yoffset = 0;
 	/* Set the device's screen information. */
 	if (ioctl(fd, FBIOPUT_VSCREENINFO, &varinfo) < 0) {
 		return -1;
-- 
1.7.9.5



More information about the wayland-devel mailing list