aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/tdfxfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tdfxfb.c')
-rw-r--r--drivers/video/tdfxfb.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 4599a4385bc9..14bd3f3680b8 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -1195,57 +1195,58 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
1195 return -ENOMEM; 1195 return -ENOMEM;
1196 1196
1197 default_par = info->par; 1197 default_par = info->par;
1198 info->fix = tdfx_fix;
1198 1199
1199 /* Configure the default fb_fix_screeninfo first */ 1200 /* Configure the default fb_fix_screeninfo first */
1200 switch (pdev->device) { 1201 switch (pdev->device) {
1201 case PCI_DEVICE_ID_3DFX_BANSHEE: 1202 case PCI_DEVICE_ID_3DFX_BANSHEE:
1202 strcpy(tdfx_fix.id, "3Dfx Banshee"); 1203 strcpy(info->fix.id, "3Dfx Banshee");
1203 default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK; 1204 default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK;
1204 break; 1205 break;
1205 case PCI_DEVICE_ID_3DFX_VOODOO3: 1206 case PCI_DEVICE_ID_3DFX_VOODOO3:
1206 strcpy(tdfx_fix.id, "3Dfx Voodoo3"); 1207 strcpy(info->fix.id, "3Dfx Voodoo3");
1207 default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK; 1208 default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK;
1208 break; 1209 break;
1209 case PCI_DEVICE_ID_3DFX_VOODOO5: 1210 case PCI_DEVICE_ID_3DFX_VOODOO5:
1210 strcpy(tdfx_fix.id, "3Dfx Voodoo5"); 1211 strcpy(info->fix.id, "3Dfx Voodoo5");
1211 default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK; 1212 default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK;
1212 break; 1213 break;
1213 } 1214 }
1214 1215
1215 tdfx_fix.mmio_start = pci_resource_start(pdev, 0); 1216 info->fix.mmio_start = pci_resource_start(pdev, 0);
1216 tdfx_fix.mmio_len = pci_resource_len(pdev, 0); 1217 info->fix.mmio_len = pci_resource_len(pdev, 0);
1217 if (!request_mem_region(tdfx_fix.mmio_start, tdfx_fix.mmio_len, 1218 if (!request_mem_region(info->fix.mmio_start, info->fix.mmio_len,
1218 "tdfx regbase")) { 1219 "tdfx regbase")) {
1219 printk(KERN_ERR "tdfxfb: Can't reserve regbase\n"); 1220 printk(KERN_ERR "tdfxfb: Can't reserve regbase\n");
1220 goto out_err; 1221 goto out_err;
1221 } 1222 }
1222 1223
1223 default_par->regbase_virt = 1224 default_par->regbase_virt =
1224 ioremap_nocache(tdfx_fix.mmio_start, tdfx_fix.mmio_len); 1225 ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len);
1225 if (!default_par->regbase_virt) { 1226 if (!default_par->regbase_virt) {
1226 printk(KERN_ERR "fb: Can't remap %s register area.\n", 1227 printk(KERN_ERR "fb: Can't remap %s register area.\n",
1227 tdfx_fix.id); 1228 info->fix.id);
1228 goto out_err_regbase; 1229 goto out_err_regbase;
1229 } 1230 }
1230 1231
1231 tdfx_fix.smem_start = pci_resource_start(pdev, 1); 1232 info->fix.smem_start = pci_resource_start(pdev, 1);
1232 tdfx_fix.smem_len = do_lfb_size(default_par, pdev->device); 1233 info->fix.smem_len = do_lfb_size(default_par, pdev->device);
1233 if (!tdfx_fix.smem_len) { 1234 if (!info->fix.smem_len) {
1234 printk(KERN_ERR "fb: Can't count %s memory.\n", tdfx_fix.id); 1235 printk(KERN_ERR "fb: Can't count %s memory.\n", info->fix.id);
1235 goto out_err_regbase; 1236 goto out_err_regbase;
1236 } 1237 }
1237 1238
1238 if (!request_mem_region(tdfx_fix.smem_start, 1239 if (!request_mem_region(info->fix.smem_start,
1239 pci_resource_len(pdev, 1), "tdfx smem")) { 1240 pci_resource_len(pdev, 1), "tdfx smem")) {
1240 printk(KERN_ERR "tdfxfb: Can't reserve smem\n"); 1241 printk(KERN_ERR "tdfxfb: Can't reserve smem\n");
1241 goto out_err_regbase; 1242 goto out_err_regbase;
1242 } 1243 }
1243 1244
1244 info->screen_base = ioremap_nocache(tdfx_fix.smem_start, 1245 info->screen_base = ioremap_nocache(info->fix.smem_start,
1245 tdfx_fix.smem_len); 1246 info->fix.smem_len);
1246 if (!info->screen_base) { 1247 if (!info->screen_base) {
1247 printk(KERN_ERR "fb: Can't remap %s framebuffer.\n", 1248 printk(KERN_ERR "fb: Can't remap %s framebuffer.\n",
1248 tdfx_fix.id); 1249 info->fix.id);
1249 goto out_err_screenbase; 1250 goto out_err_screenbase;
1250 } 1251 }
1251 1252
@@ -1257,20 +1258,19 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
1257 goto out_err_screenbase; 1258 goto out_err_screenbase;
1258 } 1259 }
1259 1260
1260 printk(KERN_INFO "fb: %s memory = %dK\n", tdfx_fix.id, 1261 printk(KERN_INFO "fb: %s memory = %dK\n", info->fix.id,
1261 tdfx_fix.smem_len >> 10); 1262 info->fix.smem_len >> 10);
1262 1263
1263 default_par->mtrr_handle = -1; 1264 default_par->mtrr_handle = -1;
1264 if (!nomtrr) 1265 if (!nomtrr)
1265 default_par->mtrr_handle = 1266 default_par->mtrr_handle =
1266 mtrr_add(tdfx_fix.smem_start, tdfx_fix.smem_len, 1267 mtrr_add(info->fix.smem_start, info->fix.smem_len,
1267 MTRR_TYPE_WRCOMB, 1); 1268 MTRR_TYPE_WRCOMB, 1);
1268 1269
1269 tdfx_fix.ypanstep = nopan ? 0 : 1; 1270 info->fix.ypanstep = nopan ? 0 : 1;
1270 tdfx_fix.ywrapstep = nowrap ? 0 : 1; 1271 info->fix.ywrapstep = nowrap ? 0 : 1;
1271 1272
1272 info->fbops = &tdfxfb_ops; 1273 info->fbops = &tdfxfb_ops;
1273 info->fix = tdfx_fix;
1274 info->pseudo_palette = default_par->palette; 1274 info->pseudo_palette = default_par->palette;
1275 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; 1275 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
1276#ifdef CONFIG_FB_3DFX_ACCEL 1276#ifdef CONFIG_FB_3DFX_ACCEL
@@ -1323,14 +1323,14 @@ out_err_iobase:
1323out_err_screenbase: 1323out_err_screenbase:
1324 if (info->screen_base) 1324 if (info->screen_base)
1325 iounmap(info->screen_base); 1325 iounmap(info->screen_base);
1326 release_mem_region(tdfx_fix.smem_start, pci_resource_len(pdev, 1)); 1326 release_mem_region(info->fix.smem_start, pci_resource_len(pdev, 1));
1327out_err_regbase: 1327out_err_regbase:
1328 /* 1328 /*
1329 * Cleanup after anything that was remapped/allocated. 1329 * Cleanup after anything that was remapped/allocated.
1330 */ 1330 */
1331 if (default_par->regbase_virt) 1331 if (default_par->regbase_virt)
1332 iounmap(default_par->regbase_virt); 1332 iounmap(default_par->regbase_virt);
1333 release_mem_region(tdfx_fix.mmio_start, tdfx_fix.mmio_len); 1333 release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
1334out_err: 1334out_err:
1335 framebuffer_release(info); 1335 framebuffer_release(info);
1336 return -ENXIO; 1336 return -ENXIO;