diff options
Diffstat (limited to 'drivers/video/intelfb/intelfbdrv.c')
| -rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 51 |
1 files changed, 20 insertions, 31 deletions
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 427689e584d..0090544842f 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
| @@ -135,9 +135,6 @@ | |||
| 135 | static void __devinit get_initial_mode(struct intelfb_info *dinfo); | 135 | static void __devinit get_initial_mode(struct intelfb_info *dinfo); |
| 136 | static void update_dinfo(struct intelfb_info *dinfo, | 136 | static void update_dinfo(struct intelfb_info *dinfo, |
| 137 | struct fb_var_screeninfo *var); | 137 | struct fb_var_screeninfo *var); |
| 138 | static int intelfb_get_fix(struct fb_fix_screeninfo *fix, | ||
| 139 | struct fb_info *info); | ||
| 140 | |||
| 141 | static int intelfb_check_var(struct fb_var_screeninfo *var, | 138 | static int intelfb_check_var(struct fb_var_screeninfo *var, |
| 142 | struct fb_info *info); | 139 | struct fb_info *info); |
| 143 | static int intelfb_set_par(struct fb_info *info); | 140 | static int intelfb_set_par(struct fb_info *info); |
| @@ -473,9 +470,9 @@ cleanup(struct intelfb_info *dinfo) | |||
| 473 | if (dinfo->aperture.virtual) | 470 | if (dinfo->aperture.virtual) |
| 474 | iounmap((void __iomem *)dinfo->aperture.virtual); | 471 | iounmap((void __iomem *)dinfo->aperture.virtual); |
| 475 | 472 | ||
| 476 | if (dinfo->mmio_base_phys) | 473 | if (dinfo->flag & INTELFB_MMIO_ACQUIRED) |
| 477 | release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); | 474 | release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); |
| 478 | if (dinfo->aperture.physical) | 475 | if (dinfo->flag & INTELFB_FB_ACQUIRED) |
| 479 | release_mem_region(dinfo->aperture.physical, | 476 | release_mem_region(dinfo->aperture.physical, |
| 480 | dinfo->aperture.size); | 477 | dinfo->aperture.size); |
| 481 | framebuffer_release(dinfo->info); | 478 | framebuffer_release(dinfo->info); |
| @@ -572,6 +569,9 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 572 | cleanup(dinfo); | 569 | cleanup(dinfo); |
| 573 | return -ENODEV; | 570 | return -ENODEV; |
| 574 | } | 571 | } |
| 572 | |||
| 573 | dinfo->flag |= INTELFB_FB_ACQUIRED; | ||
| 574 | |||
| 575 | if (!request_mem_region(dinfo->mmio_base_phys, | 575 | if (!request_mem_region(dinfo->mmio_base_phys, |
| 576 | INTEL_REG_SIZE, | 576 | INTEL_REG_SIZE, |
| 577 | INTELFB_MODULE_NAME)) { | 577 | INTELFB_MODULE_NAME)) { |
| @@ -580,6 +580,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 580 | return -ENODEV; | 580 | return -ENODEV; |
| 581 | } | 581 | } |
| 582 | 582 | ||
| 583 | dinfo->flag |= INTELFB_MMIO_ACQUIRED; | ||
| 584 | |||
| 583 | /* Get the chipset info. */ | 585 | /* Get the chipset info. */ |
| 584 | dinfo->pci_chipset = pdev->device; | 586 | dinfo->pci_chipset = pdev->device; |
| 585 | 587 | ||
| @@ -1091,7 +1093,17 @@ intelfb_set_fbinfo(struct intelfb_info *dinfo) | |||
| 1091 | return 1; | 1093 | return 1; |
| 1092 | 1094 | ||
| 1093 | info->pixmap.scan_align = 1; | 1095 | info->pixmap.scan_align = 1; |
| 1094 | 1096 | strcpy(info->fix.id, dinfo->name); | |
| 1097 | info->fix.smem_start = dinfo->fb.physical; | ||
| 1098 | info->fix.smem_len = dinfo->fb.size; | ||
| 1099 | info->fix.type = FB_TYPE_PACKED_PIXELS; | ||
| 1100 | info->fix.type_aux = 0; | ||
| 1101 | info->fix.xpanstep = 8; | ||
| 1102 | info->fix.ypanstep = 1; | ||
| 1103 | info->fix.ywrapstep = 0; | ||
| 1104 | info->fix.mmio_start = dinfo->mmio_base_phys; | ||
| 1105 | info->fix.mmio_len = INTEL_REG_SIZE; | ||
| 1106 | info->fix.accel = FB_ACCEL_I830; | ||
| 1095 | update_dinfo(dinfo, &info->var); | 1107 | update_dinfo(dinfo, &info->var); |
| 1096 | 1108 | ||
| 1097 | return 0; | 1109 | return 0; |
| @@ -1109,7 +1121,8 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var) | |||
| 1109 | dinfo->yres = var->xres; | 1121 | dinfo->yres = var->xres; |
| 1110 | dinfo->pixclock = var->pixclock; | 1122 | dinfo->pixclock = var->pixclock; |
| 1111 | 1123 | ||
| 1112 | intelfb_get_fix(&dinfo->info->fix, dinfo->info); | 1124 | dinfo->info->fix.visual = dinfo->visual; |
| 1125 | dinfo->info->fix.line_length = dinfo->pitch; | ||
| 1113 | 1126 | ||
| 1114 | switch (dinfo->bpp) { | 1127 | switch (dinfo->bpp) { |
| 1115 | case 8: | 1128 | case 8: |
| @@ -1139,30 +1152,6 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var) | |||
| 1139 | 1152 | ||
| 1140 | /* fbops functions */ | 1153 | /* fbops functions */ |
| 1141 | 1154 | ||
| 1142 | static int | ||
| 1143 | intelfb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) | ||
| 1144 | { | ||
| 1145 | struct intelfb_info *dinfo = GET_DINFO(info); | ||
| 1146 | |||
| 1147 | DBG_MSG("intelfb_get_fix\n"); | ||
| 1148 | |||
| 1149 | memset(fix, 0, sizeof(*fix)); | ||
| 1150 | strcpy(fix->id, dinfo->name); | ||
| 1151 | fix->smem_start = dinfo->fb.physical; | ||
| 1152 | fix->smem_len = dinfo->fb.size; | ||
| 1153 | fix->type = FB_TYPE_PACKED_PIXELS; | ||
| 1154 | fix->type_aux = 0; | ||
| 1155 | fix->visual = dinfo->visual; | ||
| 1156 | fix->xpanstep = 8; | ||
| 1157 | fix->ypanstep = 1; | ||
| 1158 | fix->ywrapstep = 0; | ||
| 1159 | fix->line_length = dinfo->pitch; | ||
| 1160 | fix->mmio_start = dinfo->mmio_base_phys; | ||
| 1161 | fix->mmio_len = INTEL_REG_SIZE; | ||
| 1162 | fix->accel = FB_ACCEL_I830; | ||
| 1163 | return 0; | ||
| 1164 | } | ||
| 1165 | |||
| 1166 | /*************************************************************** | 1155 | /*************************************************************** |
| 1167 | * fbdev interface * | 1156 | * fbdev interface * |
| 1168 | ***************************************************************/ | 1157 | ***************************************************************/ |
