Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 771
b: refs/heads/master
c: 917bb07
h: refs/heads/master
i:
  769: 896ab12
  767: 5686ca0
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed May 1, 2005
1 parent 6c3dda9 commit 1c4125c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7149437669f79b497830e643a2b13d26a017b038
refs/heads/master: 917bb0771aa077f62a3de75028a45f243d3954a8
26 changes: 21 additions & 5 deletions trunk/drivers/video/nvidia/nvidia.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ static int hwcur __devinitdata = 0;
static int noaccel __devinitdata = 0;
static int noscale __devinitdata = 0;
static int paneltweak __devinitdata = 0;
static int vram __devinitdata = 0;
#ifdef CONFIG_MTRR
static int nomtrr __devinitdata = 0;
#endif
Expand Down Expand Up @@ -1180,7 +1181,7 @@ static int nvidiafb_check_var(struct fb_var_screeninfo *var,

var->xres_virtual = (var->xres_virtual + 63) & ~63;

vramlen = info->fix.smem_len;
vramlen = info->screen_size;
pitch = ((var->xres_virtual * var->bits_per_pixel) + 7) / 8;
memlen = pitch * var->yres_virtual;

Expand Down Expand Up @@ -1343,7 +1344,7 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
/* maximize virtual vertical length */
lpitch = info->var.xres_virtual *
((info->var.bits_per_pixel + 7) >> 3);
info->var.yres_virtual = info->fix.smem_len / lpitch;
info->var.yres_virtual = info->screen_size / lpitch;

info->pixmap.scan_align = 4;
info->pixmap.buf_align = 4;
Expand Down Expand Up @@ -1507,12 +1508,20 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,

par->FbAddress = nvidiafb_fix.smem_start;
par->FbMapSize = par->RamAmountKBytes * 1024;
if (vram && vram * 1024 * 1024 < par->FbMapSize)
par->FbMapSize = vram * 1024 * 1024;

/* Limit amount of vram to 64 MB */
if (par->FbMapSize > 64 * 1024 * 1024)
par->FbMapSize = 64 * 1024 * 1024;

par->FbUsableSize = par->FbMapSize - (128 * 1024);
par->ScratchBufferSize = (par->Architecture < NV_ARCH_10) ? 8 * 1024 :
16 * 1024;
par->ScratchBufferStart = par->FbUsableSize - par->ScratchBufferSize;
info->screen_base = ioremap(nvidiafb_fix.smem_start, par->FbMapSize);
nvidiafb_fix.smem_len = par->FbUsableSize;
info->screen_size = par->FbUsableSize;
nvidiafb_fix.smem_len = par->RamAmountKBytes * 1024;

if (!info->screen_base) {
printk(KERN_ERR PFX "cannot ioremap FB base\n");
Expand All @@ -1524,7 +1533,8 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
#ifdef CONFIG_MTRR
if (!nomtrr) {
par->mtrr.vram = mtrr_add(nvidiafb_fix.smem_start,
par->FbMapSize, MTRR_TYPE_WRCOMB, 1);
par->RamAmountKBytes * 1024,
MTRR_TYPE_WRCOMB, 1);
if (par->mtrr.vram < 0) {
printk(KERN_ERR PFX "unable to setup MTRR\n");
} else {
Expand Down Expand Up @@ -1566,9 +1576,9 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,

err_out_iounmap_fb:
iounmap(info->screen_base);
err_out_free_base1:
fb_destroy_modedb(info->monspecs.modedb);
nvidia_delete_i2c_busses(par);
err_out_free_base1:
iounmap(par->REGS);
err_out_free_base0:
pci_release_regions(pd);
Expand Down Expand Up @@ -1645,6 +1655,8 @@ static int __devinit nvidiafb_setup(char *options)
noscale = 1;
} else if (!strncmp(this_opt, "paneltweak:", 11)) {
paneltweak = simple_strtoul(this_opt+11, NULL, 0);
} else if (!strncmp(this_opt, "vram:", 5)) {
vram = simple_strtoul(this_opt+5, NULL, 0);
#ifdef CONFIG_MTRR
} else if (!strncmp(this_opt, "nomtrr", 6)) {
nomtrr = 1;
Expand Down Expand Up @@ -1716,6 +1728,10 @@ module_param(forceCRTC, int, 0);
MODULE_PARM_DESC(forceCRTC,
"Forces usage of a particular CRTC in case autodetection "
"fails. (0 or 1) (default=autodetect)");
module_param(vram, int, 0);
MODULE_PARM_DESC(vram,
"amount of framebuffer memory to remap in MiB"
"(default=0 - remap entire memory)");
#ifdef CONFIG_MTRR
module_param(nomtrr, bool, 0);
MODULE_PARM_DESC(nomtrr, "Disables MTRR support (0 or 1=disabled) "
Expand Down

0 comments on commit 1c4125c

Please sign in to comment.