[PATCH] intelfb: Fix regression (blank display) from ioremap patch

- Workaround for the ioremap patch that produces a blank display on some
chipsets
- Make hwcursor = 0 the default. The hardware cursor does not work with all
hardware.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Antonino A. Daplas and committed by Linus Torvalds 375726d7 b2846dfa

+11 -11
+1
drivers/video/Kconfig
··· 768 select FB_CFB_FILLRECT 769 select FB_CFB_COPYAREA 770 select FB_CFB_IMAGEBLIT 771 help 772 This driver supports the on-board graphics built in to the Intel 773 830M/845G/852GM/855GM/865G chipsets.
··· 768 select FB_CFB_FILLRECT 769 select FB_CFB_COPYAREA 770 select FB_CFB_IMAGEBLIT 771 + select FB_SOFT_CURSOR 772 help 773 This driver supports the on-board graphics built in to the Intel 774 830M/845G/852GM/855GM/865G chipsets.
+10 -11
drivers/video/intelfb/intelfbdrv.c
··· 226 227 static int accel = 1; 228 static int vram = 4; 229 - static int hwcursor = 1; 230 static int mtrr = 1; 231 static int fixed = 0; 232 static int noinit = 0; ··· 609 dinfo->accel = 0; 610 } 611 612 - if (MB(voffset) < stolen_size) 613 - offset = (stolen_size >> 12); 614 - else 615 - offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; 616 - 617 /* Framebuffer parameters - Use all the stolen memory if >= vram */ 618 - if (ROUND_UP_TO_PAGE(stolen_size) >= ((offset << 12) + MB(vram))) { 619 dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); 620 - dinfo->fb.offset = 0; 621 dinfo->fbmem_gart = 0; 622 } else { 623 dinfo->fb.size = MB(vram); ··· 642 return -ENODEV; 643 } 644 645 /* set the mem offsets - set them after the already used pages */ 646 if (dinfo->accel) { 647 dinfo->ring.offset = offset + gtt_info.current_memory; ··· 661 + (dinfo->cursor.size >> 12); 662 } 663 664 /* Map the fb and MMIO regions */ 665 /* ioremap only up to the end of used aperture */ 666 dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache 667 - (dinfo->aperture.physical, (dinfo->fb.offset << 12) 668 + dinfo->fb.size); 669 if (!dinfo->aperture.virtual) { 670 ERR_MSG("Cannot remap FB region.\n"); ··· 682 return -ENODEV; 683 } 684 685 - /* Allocate memories (which aren't stolen) */ 686 if (dinfo->accel) { 687 if (!(dinfo->gtt_ring_mem = 688 agp_allocate_memory(bridge, dinfo->ring.size >> 12, ··· 1483 #endif 1484 1485 if (!dinfo->hwcursor) 1486 - return -ENXIO; 1487 1488 intelfbhw_cursor_hide(dinfo); 1489
··· 226 227 static int accel = 1; 228 static int vram = 4; 229 + static int hwcursor = 0; 230 static int mtrr = 1; 231 static int fixed = 0; 232 static int noinit = 0; ··· 609 dinfo->accel = 0; 610 } 611 612 /* Framebuffer parameters - Use all the stolen memory if >= vram */ 613 + if (ROUND_UP_TO_PAGE(stolen_size) >= MB(vram)) { 614 dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); 615 dinfo->fbmem_gart = 0; 616 } else { 617 dinfo->fb.size = MB(vram); ··· 648 return -ENODEV; 649 } 650 651 + if (MB(voffset) < stolen_size) 652 + offset = (stolen_size >> 12); 653 + else 654 + offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; 655 + 656 /* set the mem offsets - set them after the already used pages */ 657 if (dinfo->accel) { 658 dinfo->ring.offset = offset + gtt_info.current_memory; ··· 662 + (dinfo->cursor.size >> 12); 663 } 664 665 + /* Allocate memories (which aren't stolen) */ 666 /* Map the fb and MMIO regions */ 667 /* ioremap only up to the end of used aperture */ 668 dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache 669 + (dinfo->aperture.physical, ((offset + dinfo->fb.offset) << 12) 670 + dinfo->fb.size); 671 if (!dinfo->aperture.virtual) { 672 ERR_MSG("Cannot remap FB region.\n"); ··· 682 return -ENODEV; 683 } 684 685 if (dinfo->accel) { 686 if (!(dinfo->gtt_ring_mem = 687 agp_allocate_memory(bridge, dinfo->ring.size >> 12, ··· 1484 #endif 1485 1486 if (!dinfo->hwcursor) 1487 + return soft_cursor(info, cursor); 1488 1489 intelfbhw_cursor_hide(dinfo); 1490