diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2007-10-16 04:29:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:18 -0400 |
commit | e7076389f48128b00dd3f33767fb60bd3f5a06a8 (patch) | |
tree | 9c76a50342db3ad9eaa2f9dca1ebea6a8719c781 /drivers | |
parent | 36f31a7084b8d20ced37afe92238c18ba769cdf3 (diff) |
s3c2410fb: make use of default_display settings
This patch changes mode selection to always prefer default mode if possible
and always honor type of display set by default mode settings.
This patch is required in case the same display modes were defined for
different panels (e.g. STN and TFT).
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-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 f98e4335f152..ae08d4587091 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", |