* [PATCH 3/3] s3c2410fb: make use of default_display settings
@ 2007-08-15 8:26 Krzysztof Helt
0 siblings, 0 replies; only message in thread
From: Krzysztof Helt @ 2007-08-15 8:26 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: Ben Dooks, Arnaud Patard (Rtp)
[-- Attachment #1: Type: text/plain, Size: 2431 bytes --]
From: Krzysztof Helt <krzysztof.h1@wp.pl>
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>
---
This patch requires all s3c2410fb patches sent to this list.
diff -urp linux-2.6.23.old/drivers/video/s3c2410fb.c linux-
2.6.23/drivers/video/s3c2410fb.c
--- linux-2.6.23.old/drivers/video/s3c2410fb.c 2007-08-14
18:02:04.000000000 +0200
+++ linux-2.6.23/drivers/video/s3c2410fb.c 2007-08-14
20:05:10.000000000 +0200
@@ -172,19 +172,28 @@ static int s3c2410fb_check_var(struct fb
struct s3c2410fb_info *fbi = info->par;
struct s3c2410fb_mach_info *mach_info = fbi->dev-
>platform_data;
struct s3c2410fb_display *display = NULL;
+ struct s3c2410fb_display *default_display = mach_info-
>displays +
+ mach_info-
>default_display;
+ int type = default_display->type;
unsigned i;
dprintk("check_var(var=%p, info=%p)\n", var, info);
- /* validate x/y resolution */
-
- for (i = 0; i < mach_info->num_displays; i++)
- if (var->yres == mach_info->displays[i].yres &&
- var->xres == mach_info->displays[i].xres &&
- var->bits_per_pixel == mach_info-
>displays[i].bpp) {
- display = mach_info->displays + i;
- break;
- }
+ /* validate x/y resolution */
+ /* choose default mode if possible */
+ if (var->yres == default_display->yres &&
+ var->xres == default_display->xres &&
+ var->bits_per_pixel == default_display->bpp)
+ display = default_display;
+ else
+ for (i = 0; i < mach_info->num_displays; i++)
+ if (type == mach_info->displays[i].type
&&
+ var->yres == mach_info-
>displays[i].yres &&
+ var->xres == mach_info-
>displays[i].xres &&
+ var->bits_per_pixel == mach_info-
>displays[i].bpp) {
+ display = mach_info->displays +
i;
+ break;
+ }
if (!display) {
dprintk("wrong resolution or depth %dx%d at %d
bpp\n",
----------------------------------------------------
Najnowszy album światowej klasy DJ'a Paula van Dyka
"In Between" już w sklepach! Kompilacja zawiera singiel
"White Lies" z udziałem Jessica Sutta z Pussycat Dolls.
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fpaul.html&sid=1260
[-- Attachment #2: s3c2410fb-default-type.diff --]
[-- Type: application/octet-stream, Size: 2041 bytes --]
From: Krzysztof Helt <krzysztof.h1@wp.pl>
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>
---
This patch requires all s3c2410fb patches sent to this list.
diff -urp linux-2.6.23.old/drivers/video/s3c2410fb.c linux-2.6.23/drivers/video/s3c2410fb.c
--- linux-2.6.23.old/drivers/video/s3c2410fb.c 2007-08-14 18:02:04.000000000 +0200
+++ linux-2.6.23/drivers/video/s3c2410fb.c 2007-08-14 20:05:10.000000000 +0200
@@ -172,19 +172,28 @@ static int s3c2410fb_check_var(struct fb
struct s3c2410fb_info *fbi = info->par;
struct s3c2410fb_mach_info *mach_info = fbi->dev->platform_data;
struct s3c2410fb_display *display = NULL;
+ struct s3c2410fb_display *default_display = mach_info->displays +
+ mach_info->default_display;
+ int type = default_display->type;
unsigned i;
dprintk("check_var(var=%p, info=%p)\n", var, info);
- /* validate x/y resolution */
-
- for (i = 0; i < mach_info->num_displays; i++)
- if (var->yres == mach_info->displays[i].yres &&
- var->xres == mach_info->displays[i].xres &&
- var->bits_per_pixel == mach_info->displays[i].bpp) {
- display = mach_info->displays + i;
- break;
- }
+ /* validate x/y resolution */
+ /* choose default mode if possible */
+ if (var->yres == default_display->yres &&
+ var->xres == default_display->xres &&
+ var->bits_per_pixel == default_display->bpp)
+ display = default_display;
+ else
+ for (i = 0; i < mach_info->num_displays; i++)
+ if (type == mach_info->displays[i].type &&
+ var->yres == mach_info->displays[i].yres &&
+ var->xres == mach_info->displays[i].xres &&
+ var->bits_per_pixel == mach_info->displays[i].bpp) {
+ display = mach_info->displays + i;
+ break;
+ }
if (!display) {
dprintk("wrong resolution or depth %dx%d at %d bpp\n",
[-- Attachment #3: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #4: Type: text/plain, Size: 182 bytes --]
_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-15 8:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 8:26 [PATCH 3/3] s3c2410fb: make use of default_display settings Krzysztof Helt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).