Commit fa2742b3 authored by n3rdopolis's avatar n3rdopolis Committed by Daniel Stone
Browse files

libweston: fbdev: Force the Framebuffer devices to be activated.

    
This attempts to wake up secondary framebuffer devices
(/dev/fb1 and up) as usually these devices start powered off, and
the FBIOPUT_VSCREENINFO ioctl turns it on. This was tested on qemu
with two virtual QXL cards. This is a more precise way to activate
framebuffer devices with the ioctl
parent f3190a45
......@@ -362,6 +362,27 @@ fbdev_set_screen_info(int fd, struct fbdev_screeninfo *info)
return 1;
}
static int
fbdev_wakeup_screen(int fd, struct fbdev_screeninfo *info)
{
struct fb_var_screeninfo varinfo;
/* Grab the current screen information. */
if (ioctl(fd, FBIOGET_VSCREENINFO, &varinfo) < 0) {
return -1;
}
/* force the framebuffer to wake up */
varinfo.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
/* Set the device's screen information. */
if (ioctl(fd, FBIOPUT_VSCREENINFO, &varinfo) < 0) {
return -1;
}
return 1;
}
/* Returns an FD for the frame buffer device. */
static int
fbdev_frame_buffer_open(const char *fb_dev,
......@@ -390,8 +411,8 @@ fbdev_frame_buffer_open(const char *fb_dev,
/* Attempt to wake up the framebuffer device, needed for secondary
* framebuffer devices */
if (fbdev_set_screen_info(fd, screen_info) < 0) {
weston_log("Failed to set mode settings. "
if (fbdev_wakeup_screen(fd, screen_info) < 0) {
weston_log("Failed to activate framebuffer display. "
"Attempting to open output anyway.\n");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment