diff options
author | Len Brown <len.brown@intel.com> | 2005-08-15 16:02:50 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-08-15 16:02:50 -0400 |
commit | fb80cbee4c4bfeaeb2ff6611beecfb9a2443da90 (patch) | |
tree | 6e412d032cca4ddb50b8628b4bbecea120d316a7 /drivers | |
parent | b857c730d4e960d1876ff56ce5c4bd81ea9ff5ae (diff) | |
parent | 3edea4833a1efcd43e1dff082bc8001fdfe74b34 (diff) |
Merge ../from-linus
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fbmem.c | 4 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 50 |
2 files changed, 29 insertions, 25 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index d2e19f6dd72c..4ff853fbe0be 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -628,7 +628,7 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) | |||
628 | int | 628 | int |
629 | fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | 629 | fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) |
630 | { | 630 | { |
631 | int err; | 631 | int err, flags = info->flags; |
632 | 632 | ||
633 | if (var->activate & FB_ACTIVATE_INV_MODE) { | 633 | if (var->activate & FB_ACTIVATE_INV_MODE) { |
634 | struct fb_videomode mode1, mode2; | 634 | struct fb_videomode mode1, mode2; |
@@ -682,7 +682,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | |||
682 | !list_empty(&info->modelist)) | 682 | !list_empty(&info->modelist)) |
683 | err = fb_add_videomode(&mode, &info->modelist); | 683 | err = fb_add_videomode(&mode, &info->modelist); |
684 | 684 | ||
685 | if (!err && info->flags & FBINFO_MISC_USEREVENT) { | 685 | if (!err && (flags & FBINFO_MISC_USEREVENT)) { |
686 | struct fb_event event; | 686 | struct fb_event event; |
687 | 687 | ||
688 | info->flags &= ~FBINFO_MISC_USEREVENT; | 688 | info->flags &= ~FBINFO_MISC_USEREVENT; |
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 298bc9cd99e7..a112a1786855 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -583,23 +583,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
583 | return -ENODEV; | 583 | return -ENODEV; |
584 | } | 584 | } |
585 | 585 | ||
586 | /* Map the fb and MMIO regions */ | ||
587 | dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache | ||
588 | (dinfo->aperture.physical, dinfo->aperture.size); | ||
589 | if (!dinfo->aperture.virtual) { | ||
590 | ERR_MSG("Cannot remap FB region.\n"); | ||
591 | cleanup(dinfo); | ||
592 | return -ENODEV; | ||
593 | } | ||
594 | dinfo->mmio_base = | ||
595 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | ||
596 | INTEL_REG_SIZE); | ||
597 | if (!dinfo->mmio_base) { | ||
598 | ERR_MSG("Cannot remap MMIO region.\n"); | ||
599 | cleanup(dinfo); | ||
600 | return -ENODEV; | ||
601 | } | ||
602 | |||
603 | /* Get the chipset info. */ | 586 | /* Get the chipset info. */ |
604 | dinfo->pci_chipset = pdev->device; | 587 | dinfo->pci_chipset = pdev->device; |
605 | 588 | ||
@@ -630,9 +613,15 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
630 | dinfo->accel = 0; | 613 | dinfo->accel = 0; |
631 | } | 614 | } |
632 | 615 | ||
616 | if (MB(voffset) < stolen_size) | ||
617 | offset = (stolen_size >> 12); | ||
618 | else | ||
619 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | ||
620 | |||
633 | /* Framebuffer parameters - Use all the stolen memory if >= vram */ | 621 | /* Framebuffer parameters - Use all the stolen memory if >= vram */ |
634 | if (ROUND_UP_TO_PAGE(stolen_size) >= MB(vram)) { | 622 | if (ROUND_UP_TO_PAGE(stolen_size) >= ((offset << 12) + MB(vram))) { |
635 | dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); | 623 | dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); |
624 | dinfo->fb.offset = 0; | ||
636 | dinfo->fbmem_gart = 0; | 625 | dinfo->fbmem_gart = 0; |
637 | } else { | 626 | } else { |
638 | dinfo->fb.size = MB(vram); | 627 | dinfo->fb.size = MB(vram); |
@@ -663,11 +652,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
663 | return -ENODEV; | 652 | return -ENODEV; |
664 | } | 653 | } |
665 | 654 | ||
666 | if (MB(voffset) < stolen_size) | ||
667 | offset = (stolen_size >> 12); | ||
668 | else | ||
669 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | ||
670 | |||
671 | /* set the mem offsets - set them after the already used pages */ | 655 | /* set the mem offsets - set them after the already used pages */ |
672 | if (dinfo->accel) { | 656 | if (dinfo->accel) { |
673 | dinfo->ring.offset = offset + gtt_info.current_memory; | 657 | dinfo->ring.offset = offset + gtt_info.current_memory; |
@@ -682,6 +666,26 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
682 | + (dinfo->cursor.size >> 12); | 666 | + (dinfo->cursor.size >> 12); |
683 | } | 667 | } |
684 | 668 | ||
669 | /* Map the fb and MMIO regions */ | ||
670 | /* ioremap only up to the end of used aperture */ | ||
671 | dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache | ||
672 | (dinfo->aperture.physical, (dinfo->fb.offset << 12) | ||
673 | + dinfo->fb.size); | ||
674 | if (!dinfo->aperture.virtual) { | ||
675 | ERR_MSG("Cannot remap FB region.\n"); | ||
676 | cleanup(dinfo); | ||
677 | return -ENODEV; | ||
678 | } | ||
679 | |||
680 | dinfo->mmio_base = | ||
681 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | ||
682 | INTEL_REG_SIZE); | ||
683 | if (!dinfo->mmio_base) { | ||
684 | ERR_MSG("Cannot remap MMIO region.\n"); | ||
685 | cleanup(dinfo); | ||
686 | return -ENODEV; | ||
687 | } | ||
688 | |||
685 | /* Allocate memories (which aren't stolen) */ | 689 | /* Allocate memories (which aren't stolen) */ |
686 | if (dinfo->accel) { | 690 | if (dinfo->accel) { |
687 | if (!(dinfo->gtt_ring_mem = | 691 | if (!(dinfo->gtt_ring_mem = |