diff options
-rw-r--r-- | firmware/target/hosted/lcd-linuxfb.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/firmware/target/hosted/lcd-linuxfb.c b/firmware/target/hosted/lcd-linuxfb.c index 14c8c30f89..5dda5cf1cc 100644 --- a/firmware/target/hosted/lcd-linuxfb.c +++ b/firmware/target/hosted/lcd-linuxfb.c | |||
@@ -59,14 +59,21 @@ void lcd_init_device(void) | |||
59 | panicf("Cannot read framebuffer fixed information"); | 59 | panicf("Cannot read framebuffer fixed information"); |
60 | } | 60 | } |
61 | 61 | ||
62 | #if 0 | 62 | if(ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) < 0) |
63 | /* check resolution and framebuffer size */ | ||
64 | if(vinfo.xres != LCD_WIDTH || vinfo.yres != LCD_HEIGHT || vinfo.bits_per_pixel != LCD_DEPTH) | ||
65 | { | 63 | { |
66 | panicf("Unexpected framebuffer resolution: %dx%dx%d\n", vinfo.xres, | 64 | panicf("Cannot read framebuffer variable information"); |
67 | vinfo.yres, vinfo.bits_per_pixel); | 65 | } |
66 | |||
67 | /* Make sure we match our desired bitdepth */ | ||
68 | if (vinfo.bits_per_pixel != LCD_DEPTH || vinfo.xres != LCD_WIDTH || vinfo.yres != LCD_HEIGHT) { | ||
69 | vinfo.bits_per_pixel = LCD_DEPTH; | ||
70 | vinfo.xres = LCD_WIDTH; | ||
71 | vinfo.yres = LCD_HEIGHT; | ||
72 | if (ioctl(fd, FBIOPUT_VSCREENINFO, &vinfo)) { | ||
73 | panicf("Cannot set framebuffer to %dx%dx%d", | ||
74 | vinfo.xres, vinfo.yres, vinfo.bits_per_pixel); | ||
75 | } | ||
68 | } | 76 | } |
69 | #endif | ||
70 | /* Note: we use a framebuffer size of width*height*bbp. We cannot trust the | 77 | /* Note: we use a framebuffer size of width*height*bbp. We cannot trust the |
71 | * values returned by the driver for line_length */ | 78 | * values returned by the driver for line_length */ |
72 | 79 | ||
@@ -77,11 +84,6 @@ void lcd_init_device(void) | |||
77 | panicf("Cannot map framebuffer"); | 84 | panicf("Cannot map framebuffer"); |
78 | } | 85 | } |
79 | 86 | ||
80 | if(ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) < 0) | ||
81 | { | ||
82 | panicf("Cannot read framebuffer variable information"); | ||
83 | } | ||
84 | |||
85 | memset(framebuffer, 0, finfo.smem_len); | 87 | memset(framebuffer, 0, finfo.smem_len); |
86 | 88 | ||
87 | #ifdef HAVE_LCD_ENABLE | 89 | #ifdef HAVE_LCD_ENABLE |