diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-09-10 08:05:45 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-10 08:05:45 -0400 |
commit | 3ce9bcb583536c45a46c7302747029450e22279c (patch) | |
tree | 7a4167189ffc6dc909151d1a5d040f9f0656a9f4 /drivers/video | |
parent | 26fd10517e810dd59ea050b052de24a75ee6dc07 (diff) | |
parent | f7d0b926ac8c8ec0c7a83ee69409bd2e6bb39f81 (diff) |
Merge branch 'core/xen' into x86/xen
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/atmel_lcdfb.c | 10 | ||||
-rw-r--r-- | drivers/video/bf54x-lq043fb.c | 2 | ||||
-rw-r--r-- | drivers/video/cirrusfb.c | 59 | ||||
-rw-r--r-- | drivers/video/tdfxfb.c | 9 |
4 files changed, 29 insertions, 51 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 9c5925927ece..5a24c6411d34 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -939,7 +939,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) | |||
939 | ret = register_framebuffer(info); | 939 | ret = register_framebuffer(info); |
940 | if (ret < 0) { | 940 | if (ret < 0) { |
941 | dev_err(dev, "failed to register framebuffer device: %d\n", ret); | 941 | dev_err(dev, "failed to register framebuffer device: %d\n", ret); |
942 | goto free_cmap; | 942 | goto reset_drvdata; |
943 | } | 943 | } |
944 | 944 | ||
945 | /* add selected videomode to modelist */ | 945 | /* add selected videomode to modelist */ |
@@ -955,7 +955,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) | |||
955 | 955 | ||
956 | return 0; | 956 | return 0; |
957 | 957 | ||
958 | 958 | reset_drvdata: | |
959 | dev_set_drvdata(dev, NULL); | ||
959 | free_cmap: | 960 | free_cmap: |
960 | fb_dealloc_cmap(&info->cmap); | 961 | fb_dealloc_cmap(&info->cmap); |
961 | unregister_irqs: | 962 | unregister_irqs: |
@@ -992,10 +993,11 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev) | |||
992 | { | 993 | { |
993 | struct device *dev = &pdev->dev; | 994 | struct device *dev = &pdev->dev; |
994 | struct fb_info *info = dev_get_drvdata(dev); | 995 | struct fb_info *info = dev_get_drvdata(dev); |
995 | struct atmel_lcdfb_info *sinfo = info->par; | 996 | struct atmel_lcdfb_info *sinfo; |
996 | 997 | ||
997 | if (!sinfo) | 998 | if (!info || !info->par) |
998 | return 0; | 999 | return 0; |
1000 | sinfo = info->par; | ||
999 | 1001 | ||
1000 | cancel_work_sync(&sinfo->task); | 1002 | cancel_work_sync(&sinfo->task); |
1001 | exit_backlight(sinfo); | 1003 | exit_backlight(sinfo); |
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c index 6d5aa806777e..7644ed249564 100644 --- a/drivers/video/bf54x-lq043fb.c +++ b/drivers/video/bf54x-lq043fb.c | |||
@@ -58,7 +58,7 @@ | |||
58 | #include <asm/gpio.h> | 58 | #include <asm/gpio.h> |
59 | #include <asm/portmux.h> | 59 | #include <asm/portmux.h> |
60 | 60 | ||
61 | #include <asm/mach/bf54x-lq043.h> | 61 | #include <mach/bf54x-lq043.h> |
62 | 62 | ||
63 | #define NO_BL_SUPPORT | 63 | #define NO_BL_SUPPORT |
64 | 64 | ||
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index c14b2435d23e..e729fb279645 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c | |||
@@ -628,27 +628,18 @@ static long cirrusfb_get_mclk(long freq, int bpp, long *div) | |||
628 | static int cirrusfb_check_var(struct fb_var_screeninfo *var, | 628 | static int cirrusfb_check_var(struct fb_var_screeninfo *var, |
629 | struct fb_info *info) | 629 | struct fb_info *info) |
630 | { | 630 | { |
631 | int nom, den; /* translyting from pixels->bytes */ | 631 | int yres; |
632 | int yres, i; | 632 | /* memory size in pixels */ |
633 | static struct { int xres, yres; } modes[] = | 633 | unsigned pixels = info->screen_size * 8 / var->bits_per_pixel; |
634 | { { 1600, 1280 }, | ||
635 | { 1280, 1024 }, | ||
636 | { 1024, 768 }, | ||
637 | { 800, 600 }, | ||
638 | { 640, 480 }, | ||
639 | { -1, -1 } }; | ||
640 | 634 | ||
641 | switch (var->bits_per_pixel) { | 635 | switch (var->bits_per_pixel) { |
642 | case 1: | 636 | case 1: |
643 | nom = 4; | 637 | pixels /= 4; |
644 | den = 8; | ||
645 | break; /* 8 pixel per byte, only 1/4th of mem usable */ | 638 | break; /* 8 pixel per byte, only 1/4th of mem usable */ |
646 | case 8: | 639 | case 8: |
647 | case 16: | 640 | case 16: |
648 | case 24: | 641 | case 24: |
649 | case 32: | 642 | case 32: |
650 | nom = var->bits_per_pixel / 8; | ||
651 | den = 1; | ||
652 | break; /* 1 pixel == 1 byte */ | 643 | break; /* 1 pixel == 1 byte */ |
653 | default: | 644 | default: |
654 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." | 645 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." |
@@ -658,43 +649,29 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var, | |||
658 | return -EINVAL; | 649 | return -EINVAL; |
659 | } | 650 | } |
660 | 651 | ||
661 | if (var->xres * nom / den * var->yres > info->screen_size) { | 652 | if (var->xres_virtual < var->xres) |
662 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." | 653 | var->xres_virtual = var->xres; |
663 | "resolution too high to fit into video memory!\n", | ||
664 | var->xres, var->yres, var->bits_per_pixel); | ||
665 | DPRINTK("EXIT - EINVAL error\n"); | ||
666 | return -EINVAL; | ||
667 | } | ||
668 | |||
669 | /* use highest possible virtual resolution */ | 654 | /* use highest possible virtual resolution */ |
670 | if (var->xres_virtual == -1 && | 655 | if (var->yres_virtual == -1) { |
671 | var->yres_virtual == -1) { | 656 | var->yres_virtual = pixels / var->xres_virtual; |
672 | printk(KERN_INFO | ||
673 | "cirrusfb: using maximum available virtual resolution\n"); | ||
674 | for (i = 0; modes[i].xres != -1; i++) { | ||
675 | int size = modes[i].xres * nom / den * modes[i].yres; | ||
676 | if (size < info->screen_size / 2) | ||
677 | break; | ||
678 | } | ||
679 | if (modes[i].xres == -1) { | ||
680 | printk(KERN_ERR "cirrusfb: could not find a virtual " | ||
681 | "resolution that fits into video memory!!\n"); | ||
682 | DPRINTK("EXIT - EINVAL error\n"); | ||
683 | return -EINVAL; | ||
684 | } | ||
685 | var->xres_virtual = modes[i].xres; | ||
686 | var->yres_virtual = modes[i].yres; | ||
687 | 657 | ||
688 | printk(KERN_INFO "cirrusfb: virtual resolution set to " | 658 | printk(KERN_INFO "cirrusfb: virtual resolution set to " |
689 | "maximum of %dx%d\n", var->xres_virtual, | 659 | "maximum of %dx%d\n", var->xres_virtual, |
690 | var->yres_virtual); | 660 | var->yres_virtual); |
691 | } | 661 | } |
692 | |||
693 | if (var->xres_virtual < var->xres) | ||
694 | var->xres_virtual = var->xres; | ||
695 | if (var->yres_virtual < var->yres) | 662 | if (var->yres_virtual < var->yres) |
696 | var->yres_virtual = var->yres; | 663 | var->yres_virtual = var->yres; |
697 | 664 | ||
665 | if (var->xres_virtual * var->yres_virtual > pixels) { | ||
666 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected... " | ||
667 | "virtual resolution too high to fit into video memory!\n", | ||
668 | var->xres_virtual, var->yres_virtual, | ||
669 | var->bits_per_pixel); | ||
670 | DPRINTK("EXIT - EINVAL error\n"); | ||
671 | return -EINVAL; | ||
672 | } | ||
673 | |||
674 | |||
698 | if (var->xoffset < 0) | 675 | if (var->xoffset < 0) |
699 | var->xoffset = 0; | 676 | var->xoffset = 0; |
700 | if (var->yoffset < 0) | 677 | if (var->yoffset < 0) |
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 77aafcfae037..4599a4385bc9 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c | |||
@@ -95,7 +95,6 @@ static inline int mtrr_del(int reg, unsigned long base, | |||
95 | #define VOODOO5_MAX_PIXCLOCK 350000 | 95 | #define VOODOO5_MAX_PIXCLOCK 350000 |
96 | 96 | ||
97 | static struct fb_fix_screeninfo tdfx_fix __devinitdata = { | 97 | static struct fb_fix_screeninfo tdfx_fix __devinitdata = { |
98 | .id = "3Dfx", | ||
99 | .type = FB_TYPE_PACKED_PIXELS, | 98 | .type = FB_TYPE_PACKED_PIXELS, |
100 | .visual = FB_VISUAL_PSEUDOCOLOR, | 99 | .visual = FB_VISUAL_PSEUDOCOLOR, |
101 | .ypanstep = 1, | 100 | .ypanstep = 1, |
@@ -426,7 +425,7 @@ static unsigned long do_lfb_size(struct tdfx_par *par, unsigned short dev_id) | |||
426 | if (dev_id < PCI_DEVICE_ID_3DFX_VOODOO5) { | 425 | if (dev_id < PCI_DEVICE_ID_3DFX_VOODOO5) { |
427 | /* Banshee/Voodoo3 */ | 426 | /* Banshee/Voodoo3 */ |
428 | chip_size = 2; | 427 | chip_size = 2; |
429 | if (has_sgram && (draminit0 & DRAMINIT0_SGRAM_TYPE)) | 428 | if (has_sgram && !(draminit0 & DRAMINIT0_SGRAM_TYPE)) |
430 | chip_size = 1; | 429 | chip_size = 1; |
431 | } else { | 430 | } else { |
432 | /* Voodoo4/5 */ | 431 | /* Voodoo4/5 */ |
@@ -1200,15 +1199,15 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev, | |||
1200 | /* Configure the default fb_fix_screeninfo first */ | 1199 | /* Configure the default fb_fix_screeninfo first */ |
1201 | switch (pdev->device) { | 1200 | switch (pdev->device) { |
1202 | case PCI_DEVICE_ID_3DFX_BANSHEE: | 1201 | case PCI_DEVICE_ID_3DFX_BANSHEE: |
1203 | strcat(tdfx_fix.id, " Banshee"); | 1202 | strcpy(tdfx_fix.id, "3Dfx Banshee"); |
1204 | default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK; | 1203 | default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK; |
1205 | break; | 1204 | break; |
1206 | case PCI_DEVICE_ID_3DFX_VOODOO3: | 1205 | case PCI_DEVICE_ID_3DFX_VOODOO3: |
1207 | strcat(tdfx_fix.id, " Voodoo3"); | 1206 | strcpy(tdfx_fix.id, "3Dfx Voodoo3"); |
1208 | default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK; | 1207 | default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK; |
1209 | break; | 1208 | break; |
1210 | case PCI_DEVICE_ID_3DFX_VOODOO5: | 1209 | case PCI_DEVICE_ID_3DFX_VOODOO5: |
1211 | strcat(tdfx_fix.id, " Voodoo5"); | 1210 | strcpy(tdfx_fix.id, "3Dfx Voodoo5"); |
1212 | default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK; | 1211 | default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK; |
1213 | break; | 1212 | break; |
1214 | } | 1213 | } |