Skip to contentSkip to conversation

SM501 and S3C2410 fb driver fixes for 2.6.24-rc3

PATCH New Ben Dooks 1 participant 6 messages Nov 19, 2007

Subsystems (2)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 SM501 and S3C2410 fb driver fixes for 2.6.24-rc3

Fixes for both the SM501 and S3C2410 framebuffer
drivers for 2.6.24-rc3

Signature · 8 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
author
#1 lore raw

PATCH 1/1 FB/SM501: Ensure console suspended before saving state

Move the console suspend to before we save the state of the framebuffer to ensure that it does not try and change the fb state again once we have copied it out.

drivers/video/sm501fb.c +9 -6
Index: linux-2.6.22-quilt9/drivers/video/sm501fb.c
===================================================================
@@ -1681,6 +1681,15 @@ static int sm501fb_suspend_fb(struct sm5
 	if (par->screen.size == 0)
 		return 0;
 
+	/* blank the relevant interface to ensure unit power minimised */
+	(par->ops.fb_blank)(FB_BLANK_POWERDOWN, fbi);
+
+	/* tell console/fb driver we are suspending */
+
+	acquire_console_sem();
+	fb_set_suspend(fbi, 1);
+	release_console_sem();
+
 	/* backup copies in case chip is powered down over suspend */
 
 	par->store_fb = vmalloc(par->screen.size);
@@ -1700,12 +1709,6 @@ static int sm501fb_suspend_fb(struct sm5
 
 	memcpy_fromio(par->store_fb, par->screen.k_addr, par->screen.size);
 	memcpy_fromio(par->store_cursor, par->cursor.k_addr, par->cursor.size);
-	/* blank the relevant interface to ensure unit power minimised */
-	(par->ops.fb_blank)(FB_BLANK_POWERDOWN, fbi);
-
-	acquire_console_sem();
-	fb_set_suspend(fbi, 1);
-	release_console_sem();
 
 	return 0;
 
Signature · 8 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
author
#2 lore raw

PATCH 1/1 FB: Fix resume path in S3C2410 framebuffer driver.

In reply to Ben Dooks

Ensure that the LCD engine is correctly re-initialised and the correct parameters passed ot s3c2410fb_init_registers.

drivers/video/s3c2410fb.c +5 -1
Index: linux-2.6.24-rc3-fb1/drivers/video/s3c2410fb.c
===================================================================
@@ -1026,7 +1026,11 @@ static int s3c2410fb_resume(struct platf
 	clk_enable(info->clk);
 	msleep(1);
 
-	s3c2410fb_init_registers(info);
+	s3c2410fb_init_registers(fbinfo);
+
+	/* re-activate our display after resume */
+	s3c2410fb_activate_var(fbinfo);
+	s3c2410fb_blank(FB_BLANK_UNBLANK, fbinfo);
 
 	return 0;
 }
Signature · 8 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
author
#3 lore raw

PATCH 1/1 FB: Update debugging in S3C2410 framebuffer driver

In reply to Ben Dooks

Update the debugging in the s3c2410 framebuffer driver.

drivers/video/s3c2410fb.c +2 -1
Index: linux-2.6.24-rc3-fb1/drivers/video/s3c2410fb.c
===================================================================
@@ -663,7 +663,7 @@ static int __init s3c2410fb_map_video_me
 	dma_addr_t map_dma;
 	unsigned map_size = PAGE_ALIGN(info->fix.smem_len);
 
-	dprintk("map_video_memory(fbi=%p)\n", fbi);
+	dprintk("map_video_memory(fbi=%p) map_size %u\n", fbi, map_size);
 
 	info->screen_base = dma_alloc_writecombine(fbi->dev, map_size,
 						   &map_dma, GFP_KERNEL);
@@ -891,6 +891,7 @@ static int __init s3c2410fb_probe(struct
 		smem_len *= mach_info->displays[i].yres;
 		smem_len *= mach_info->displays[i].bpp;
 		smem_len >>= 3;
+
 		if (fbinfo->fix.smem_len < smem_len)
 			fbinfo->fix.smem_len = smem_len;
 	}
Signature · 8 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
author
#4 lore raw

PATCH 1/1 FB: Ensure S3C2410 framebuffer clears initial memory to black

In reply to Ben Dooks

Change the initial pattern in the s3c2410 framebuffer driver to black.

drivers/video/s3c2410fb.c +1 -1
Index: linux-2.6.24-rc3-fb1/drivers/video/s3c2410fb.c
===================================================================
@@ -672,7 +672,7 @@ static int __init s3c2410fb_map_video_me
 		/* prevent initial garbage on screen */
 		dprintk("map_video_memory: clear %p:%08x\n",
 			info->screen_base, map_size);
-		memset(info->screen_base, 0xf0, map_size);
+		memset(info->screen_base, 0x00, map_size);
 
 		info->fix.smem_start = map_dma;
 
Signature · 8 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
author
#5 lore raw

PATCH 1/1 FB: Check default_display parameter passed in platform data

In reply to Ben Dooks

Ensure that the default display parameter passed in via the device's platform data is valid. It turns out when mach-bast.c was updated, the default_display was set outside of the display array bounds, causing a panic on startup.

If the default_display is bigger than num_displays, then generate an error and refuse to initialise the driver.

drivers/video/s3c2410fb.c +6 -0
Index: linux-2.6.24-rc3-fb1/drivers/video/s3c2410fb.c
===================================================================
@@ -799,6 +799,12 @@ static int __init s3c2410fb_probe(struct
 		return -EINVAL;
 	}
 
+	if (mach_info->default_display >= mach_info->num_displays) {
+		dev_err(&pdev->dev, "default is %d but only %d displays\n",
+			mach_info->default_display, mach_info->num_displays);
+		return -EINVAL;
+	}
+
 	display = mach_info->displays + mach_info->default_display;
 
 	irq = platform_get_irq(pdev, 0);
Signature · 8 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/