summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2008-03-10 11:44:01 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-03-10 18:01:20 -0700
commit62347218243179a6ab03fe9f965a5819c4714bf8 (patch)
tree8e2d022e4ef01808fe523d558ff24b007b3dbd30 /drivers
parent1039edc98a80aece735b0c6d8b4e5f9dcec2cc32 (diff)
downloadop-kernel-dev-62347218243179a6ab03fe9f965a5819c4714bf8.zip
op-kernel-dev-62347218243179a6ab03fe9f965a5819c4714bf8.tar.gz
stifb: fix crash A1439A CRX (Rattler) graphics card
Fix kernel crash when stifb driver is used with a A1439A CRX (Rattler) graphics card. (Reference: http://thread.gmane.org/gmane.linux.ports.hppa/1834) Signed-off-by: Helge Deller <deller@gmx.de> 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/stifb.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c
index e7c8db2..f98be30 100644
--- a/drivers/video/stifb.c
+++ b/drivers/video/stifb.c
@@ -505,16 +505,24 @@ ngleSetupAttrPlanes(struct stifb_info *fb, int BufferNumber)
static void
rattlerSetupPlanes(struct stifb_info *fb)
{
+ int saved_id, y;
+
+ /* Write RAMDAC pixel read mask register so all overlay
+ * planes are display-enabled. (CRX24 uses Bt462 pixel
+ * read mask register for overlay planes, not image planes).
+ */
CRX24_SETUP_RAMDAC(fb);
- /* replacement for: SETUP_FB(fb, CRX24_OVERLAY_PLANES); */
- WRITE_WORD(0x83000300, fb, REG_14);
- SETUP_HW(fb);
- WRITE_BYTE(1, fb, REG_16b1);
+ /* change fb->id temporarily to fool SETUP_FB() */
+ saved_id = fb->id;
+ fb->id = CRX24_OVERLAY_PLANES;
+ SETUP_FB(fb);
+ fb->id = saved_id;
+
+ for (y = 0; y < fb->info.var.yres; ++y)
+ memset(fb->info.screen_base + y * fb->info.fix.line_length,
+ 0xff, fb->info.var.xres * fb->info.var.bits_per_pixel/8);
- fb_memset((void*)fb->info.fix.smem_start, 0xff,
- fb->info.var.yres*fb->info.fix.line_length);
-
CRX24_SET_OVLY_MASK(fb);
SETUP_FB(fb);
}
OpenPOWER on IntegriCloud