Skip to contentSkip to conversation

fbdev: sh_mobile_lcdcfb: fix bug in reconfig()

PATCH Applied Arnd Hannemann 2 participants 2 messages Nov 15, 2010 – Nov 16, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: sh_mobile_lcdcfb: fix bug in reconfig()

The function sh_mobile_fb_reconfig() contained a bug, which caused the line_length to be set wrongly, if a mode with a different X-resolution than the default one was chosen. This caused 1080p24 mode to not work on AP4EVB. Additionally the notifier chain was also called with the wrong mode.

This patch fixes this, by using the X-resolution of the new mode instead of the old one to calculate line length and hands over the correct mode to the notifier chain.

---
 drivers/video/sh_mobile_lcdcfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/video/sh_mobile_lcdcfb.c +2 -2
index 993be38..7c2c314 100644
@@ -860,7 +860,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info)
 		/* Couldn't reconfigure, hopefully, can continue as before */
 		return;
 
-	info->fix.line_length = mode2.xres * (ch->cfg.bpp / 8);
+	info->fix.line_length = mode1.xres * (ch->cfg.bpp / 8);
 
 	/*
 	 * fb_set_var() calls the notifier change internally, only if
@@ -868,7 +868,7 @@ static void sh_mobile_fb_reconfig(struct fb_info *info)
 	 * user event, we have to call the chain ourselves.
 	 */
 	event.info = info;
-	event.data = &mode2;
+	event.data = &mode1;
 	fb_notifier_call_chain(evnt, &event);
 }
 
Signature · 1 line
1.7.0.4
Applied
#1 lore raw
Quoted 7 lines · Arnd Hannemann

The function sh_mobile_fb_reconfig() contained a bug, which caused the line_length to be set wrongly, if a mode with a different X-resolution than the default one was chosen. This caused 1080p24 mode to not work on AP4EVB. Additionally the notifier chain was also called with the wrong mode.

Quoted 5 lines

This patch fixes this, by using the X-resolution of the new mode instead of the old one to calculate line length and hands over the correct mode to the notifier chain.

Applied, thanks.