diff options
Diffstat (limited to 'drivers/video/s3c2410fb.c')
-rw-r--r-- | drivers/video/s3c2410fb.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index f98e4335f15..ae08d458709 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c | |||
@@ -172,19 +172,28 @@ static int s3c2410fb_check_var(struct fb_var_screeninfo *var, | |||
172 | struct s3c2410fb_info *fbi = info->par; | 172 | struct s3c2410fb_info *fbi = info->par; |
173 | struct s3c2410fb_mach_info *mach_info = fbi->dev->platform_data; | 173 | struct s3c2410fb_mach_info *mach_info = fbi->dev->platform_data; |
174 | struct s3c2410fb_display *display = NULL; | 174 | struct s3c2410fb_display *display = NULL; |
175 | struct s3c2410fb_display *default_display = mach_info->displays + | ||
176 | mach_info->default_display; | ||
177 | int type = default_display->type; | ||
175 | unsigned i; | 178 | unsigned i; |
176 | 179 | ||
177 | dprintk("check_var(var=%p, info=%p)\n", var, info); | 180 | dprintk("check_var(var=%p, info=%p)\n", var, info); |
178 | 181 | ||
179 | /* validate x/y resolution */ | 182 | /* validate x/y resolution */ |
180 | 183 | /* choose default mode if possible */ | |
181 | for (i = 0; i < mach_info->num_displays; i++) | 184 | if (var->yres == default_display->yres && |
182 | if (var->yres == mach_info->displays[i].yres && | 185 | var->xres == default_display->xres && |
183 | var->xres == mach_info->displays[i].xres && | 186 | var->bits_per_pixel == default_display->bpp) |
184 | var->bits_per_pixel == mach_info->displays[i].bpp) { | 187 | display = default_display; |
185 | display = mach_info->displays + i; | 188 | else |
186 | break; | 189 | for (i = 0; i < mach_info->num_displays; i++) |
187 | } | 190 | if (type == mach_info->displays[i].type && |
191 | var->yres == mach_info->displays[i].yres && | ||
192 | var->xres == mach_info->displays[i].xres && | ||
193 | var->bits_per_pixel == mach_info->displays[i].bpp) { | ||
194 | display = mach_info->displays + i; | ||
195 | break; | ||
196 | } | ||
188 | 197 | ||
189 | if (!display) { | 198 | if (!display) { |
190 | dprintk("wrong resolution or depth %dx%d at %d bpp\n", | 199 | dprintk("wrong resolution or depth %dx%d at %d bpp\n", |