linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* i810fb: fix wrong pixclock for discrete mode selection
@ 2009-11-19 17:58 Krzysztof Helt
  2009-11-19 22:17 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Helt @ 2009-11-19 17:58 UTC (permalink / raw)
  To: Linux-fbdev-devel; +Cc: Andrew Morton

From: Krzysztof Helt <krzysztof.h1@wp.pl>

If the i810fb driver is configured for use only predefined discrete video modes
the wrong pixclock value is used. The par->regs.pixclock value is a value from
the previous mode when a video mode is switched. It results in unreadable screen
if the old video mode has higher resolution and the new mode with the old (high)
pixclock is outside attached monitor's specs.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---
I have noticed this testing the patch named "i810fb: Fix stack exploding".

This patch requires my patch send to Alan Cox and Andrew Morton 
named "i810fb: Fix stack exploding".

--- drivers/video/i810/i810_dvt.c~	2009-11-17 19:38:11.002864450 +0100
+++ drivers/video/i810/i810_dvt.c	2009-11-19 18:48:52.518846238 +0100
@@ -233,7 +233,7 @@ static int i810fb_find_best_mode(u32 xre
 void i810fb_encode_registers(const struct fb_var_screeninfo *var,
 			     struct i810fb_par *par, u32 xres, u32 yres)
 {
-	u32 i_best = i810fb_find_best_mode(xres, yres, par->regs.pixclock);
+	u32 i_best = i810fb_find_best_mode(xres, yres, var->pixclock);
 
 	par->regs = std_modes[i_best];
 

----------------------------------------------------------------------
Najlepsze oferty Sylwestrowe!
Sprawdz >>> http://link.interia.pl/f2426


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: i810fb: fix wrong pixclock for discrete mode selection
  2009-11-19 17:58 i810fb: fix wrong pixclock for discrete mode selection Krzysztof Helt
@ 2009-11-19 22:17 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2009-11-19 22:17 UTC (permalink / raw)
  To: Krzysztof Helt; +Cc: Linux-fbdev-devel

On Thu, 19 Nov 2009 18:58:01 +0100
Krzysztof Helt <krzysztof.h1@poczta.fm> wrote:

> From: Krzysztof Helt <krzysztof.h1@wp.pl>
> 
> If the i810fb driver is configured for use only predefined discrete video modes
> the wrong pixclock value is used. The par->regs.pixclock value is a value from
> the previous mode when a video mode is switched. It results in unreadable screen
> if the old video mode has higher resolution and the new mode with the old (high)
> pixclock is outside attached monitor's specs.
> 
> Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
> ---
> I have noticed this testing the patch named "i810fb: Fix stack exploding".
> 
> This patch requires my patch send to Alan Cox and Andrew Morton 
> named "i810fb: Fix stack exploding".
> 
> --- drivers/video/i810/i810_dvt.c~	2009-11-17 19:38:11.002864450 +0100
> +++ drivers/video/i810/i810_dvt.c	2009-11-19 18:48:52.518846238 +0100

Please use `patch -p1' form.  That would be:

--- a/drivers/video/i810/i810_dvt.c
+++ a/drivers/video/i810/i810_dvt.c

> @@ -233,7 +233,7 @@ static int i810fb_find_best_mode(u32 xre
>  void i810fb_encode_registers(const struct fb_var_screeninfo *var,
>  			     struct i810fb_par *par, u32 xres, u32 yres)
>  {
> -	u32 i_best = i810fb_find_best_mode(xres, yres, par->regs.pixclock);
> +	u32 i_best = i810fb_find_best_mode(xres, yres, var->pixclock);
>  
>  	par->regs = std_modes[i_best];

Confused.  My drivers/video/i810/i810_dvt.c is quiet different from yours:

void i810fb_encode_registers(const struct fb_var_screeninfo *var,
			     struct i810fb_par *par, u32 xres, u32 yres)
{ 
	u32 diff = 0, diff_best = 0xFFFFFFFF, i = 0, i_best = 0; 
	u8 hfl;


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-19 22:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-19 17:58 i810fb: fix wrong pixclock for discrete mode selection Krzysztof Helt
2009-11-19 22:17 ` Andrew Morton

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).