Commit 3b25613c authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Linus Torvalds

tdfxfb: do not make changes to default tdfx_fix

This was suggested by Geert Uytterhoeven to avoid overwriting of default
values from the tdfx_fix.
Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3a568051
...@@ -1195,57 +1195,58 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev, ...@@ -1195,57 +1195,58 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
return -ENOMEM; return -ENOMEM;
default_par = info->par; default_par = info->par;
info->fix = tdfx_fix;
/* Configure the default fb_fix_screeninfo first */ /* Configure the default fb_fix_screeninfo first */
switch (pdev->device) { switch (pdev->device) {
case PCI_DEVICE_ID_3DFX_BANSHEE: case PCI_DEVICE_ID_3DFX_BANSHEE:
strcpy(tdfx_fix.id, "3Dfx Banshee"); strcpy(info->fix.id, "3Dfx Banshee");
default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK; default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK;
break; break;
case PCI_DEVICE_ID_3DFX_VOODOO3: case PCI_DEVICE_ID_3DFX_VOODOO3:
strcpy(tdfx_fix.id, "3Dfx Voodoo3"); strcpy(info->fix.id, "3Dfx Voodoo3");
default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK; default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK;
break; break;
case PCI_DEVICE_ID_3DFX_VOODOO5: case PCI_DEVICE_ID_3DFX_VOODOO5:
strcpy(tdfx_fix.id, "3Dfx Voodoo5"); strcpy(info->fix.id, "3Dfx Voodoo5");
default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK; default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK;
break; break;
} }
tdfx_fix.mmio_start = pci_resource_start(pdev, 0); info->fix.mmio_start = pci_resource_start(pdev, 0);
tdfx_fix.mmio_len = pci_resource_len(pdev, 0); info->fix.mmio_len = pci_resource_len(pdev, 0);
if (!request_mem_region(tdfx_fix.mmio_start, tdfx_fix.mmio_len, if (!request_mem_region(info->fix.mmio_start, info->fix.mmio_len,
"tdfx regbase")) { "tdfx regbase")) {
printk(KERN_ERR "tdfxfb: Can't reserve regbase\n"); printk(KERN_ERR "tdfxfb: Can't reserve regbase\n");
goto out_err; goto out_err;
} }
default_par->regbase_virt = default_par->regbase_virt =
ioremap_nocache(tdfx_fix.mmio_start, tdfx_fix.mmio_len); ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len);
if (!default_par->regbase_virt) { if (!default_par->regbase_virt) {
printk(KERN_ERR "fb: Can't remap %s register area.\n", printk(KERN_ERR "fb: Can't remap %s register area.\n",
tdfx_fix.id); info->fix.id);
goto out_err_regbase; goto out_err_regbase;
} }
tdfx_fix.smem_start = pci_resource_start(pdev, 1); info->fix.smem_start = pci_resource_start(pdev, 1);
tdfx_fix.smem_len = do_lfb_size(default_par, pdev->device); info->fix.smem_len = do_lfb_size(default_par, pdev->device);
if (!tdfx_fix.smem_len) { if (!info->fix.smem_len) {
printk(KERN_ERR "fb: Can't count %s memory.\n", tdfx_fix.id); printk(KERN_ERR "fb: Can't count %s memory.\n", info->fix.id);
goto out_err_regbase; goto out_err_regbase;
} }
if (!request_mem_region(tdfx_fix.smem_start, if (!request_mem_region(info->fix.smem_start,
pci_resource_len(pdev, 1), "tdfx smem")) { pci_resource_len(pdev, 1), "tdfx smem")) {
printk(KERN_ERR "tdfxfb: Can't reserve smem\n"); printk(KERN_ERR "tdfxfb: Can't reserve smem\n");
goto out_err_regbase; goto out_err_regbase;
} }
info->screen_base = ioremap_nocache(tdfx_fix.smem_start, info->screen_base = ioremap_nocache(info->fix.smem_start,
tdfx_fix.smem_len); info->fix.smem_len);
if (!info->screen_base) { if (!info->screen_base) {
printk(KERN_ERR "fb: Can't remap %s framebuffer.\n", printk(KERN_ERR "fb: Can't remap %s framebuffer.\n",
tdfx_fix.id); info->fix.id);
goto out_err_screenbase; goto out_err_screenbase;
} }
...@@ -1257,20 +1258,19 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev, ...@@ -1257,20 +1258,19 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
goto out_err_screenbase; goto out_err_screenbase;
} }
printk(KERN_INFO "fb: %s memory = %dK\n", tdfx_fix.id, printk(KERN_INFO "fb: %s memory = %dK\n", info->fix.id,
tdfx_fix.smem_len >> 10); info->fix.smem_len >> 10);
default_par->mtrr_handle = -1; default_par->mtrr_handle = -1;
if (!nomtrr) if (!nomtrr)
default_par->mtrr_handle = default_par->mtrr_handle =
mtrr_add(tdfx_fix.smem_start, tdfx_fix.smem_len, mtrr_add(info->fix.smem_start, info->fix.smem_len,
MTRR_TYPE_WRCOMB, 1); MTRR_TYPE_WRCOMB, 1);
tdfx_fix.ypanstep = nopan ? 0 : 1; info->fix.ypanstep = nopan ? 0 : 1;
tdfx_fix.ywrapstep = nowrap ? 0 : 1; info->fix.ywrapstep = nowrap ? 0 : 1;
info->fbops = &tdfxfb_ops; info->fbops = &tdfxfb_ops;
info->fix = tdfx_fix;
info->pseudo_palette = default_par->palette; info->pseudo_palette = default_par->palette;
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
#ifdef CONFIG_FB_3DFX_ACCEL #ifdef CONFIG_FB_3DFX_ACCEL
...@@ -1323,14 +1323,14 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev, ...@@ -1323,14 +1323,14 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
out_err_screenbase: out_err_screenbase:
if (info->screen_base) if (info->screen_base)
iounmap(info->screen_base); iounmap(info->screen_base);
release_mem_region(tdfx_fix.smem_start, pci_resource_len(pdev, 1)); release_mem_region(info->fix.smem_start, pci_resource_len(pdev, 1));
out_err_regbase: out_err_regbase:
/* /*
* Cleanup after anything that was remapped/allocated. * Cleanup after anything that was remapped/allocated.
*/ */
if (default_par->regbase_virt) if (default_par->regbase_virt)
iounmap(default_par->regbase_virt); iounmap(default_par->regbase_virt);
release_mem_region(tdfx_fix.mmio_start, tdfx_fix.mmio_len); release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
out_err: out_err:
framebuffer_release(info); framebuffer_release(info);
return -ENXIO; return -ENXIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment