Commit 62347218 authored by Helge Deller's avatar Helge Deller Committed by Linus Torvalds

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: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1039edc9
...@@ -505,15 +505,23 @@ ngleSetupAttrPlanes(struct stifb_info *fb, int BufferNumber) ...@@ -505,15 +505,23 @@ ngleSetupAttrPlanes(struct stifb_info *fb, int BufferNumber)
static void static void
rattlerSetupPlanes(struct stifb_info *fb) 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); CRX24_SETUP_RAMDAC(fb);
/* replacement for: SETUP_FB(fb, CRX24_OVERLAY_PLANES); */ /* change fb->id temporarily to fool SETUP_FB() */
WRITE_WORD(0x83000300, fb, REG_14); saved_id = fb->id;
SETUP_HW(fb); fb->id = CRX24_OVERLAY_PLANES;
WRITE_BYTE(1, fb, REG_16b1); SETUP_FB(fb);
fb->id = saved_id;
fb_memset((void*)fb->info.fix.smem_start, 0xff, for (y = 0; y < fb->info.var.yres; ++y)
fb->info.var.yres*fb->info.fix.line_length); memset(fb->info.screen_base + y * fb->info.fix.line_length,
0xff, fb->info.var.xres * fb->info.var.bits_per_pixel/8);
CRX24_SET_OVLY_MASK(fb); CRX24_SET_OVLY_MASK(fb);
SETUP_FB(fb); SETUP_FB(fb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment