diff options
author | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:15 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:59 -0400 |
commit | 07f9479a40cc778bc1462ada11f95b01360ae4ff (patch) | |
tree | 0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /drivers/video/vesafb.c | |
parent | 9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff) | |
parent | cd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff) |
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be
applied for files that didn't exist on the old branch.
Diffstat (limited to 'drivers/video/vesafb.c')
-rw-r--r-- | drivers/video/vesafb.c | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index 6a069d047914..a99bbe86db13 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c | |||
@@ -303,19 +303,6 @@ static int __init vesafb_probe(struct platform_device *dev) | |||
303 | info->apertures->ranges[0].base = screen_info.lfb_base; | 303 | info->apertures->ranges[0].base = screen_info.lfb_base; |
304 | info->apertures->ranges[0].size = size_total; | 304 | info->apertures->ranges[0].size = size_total; |
305 | 305 | ||
306 | info->screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len); | ||
307 | if (!info->screen_base) { | ||
308 | printk(KERN_ERR | ||
309 | "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n", | ||
310 | vesafb_fix.smem_len, vesafb_fix.smem_start); | ||
311 | err = -EIO; | ||
312 | goto err; | ||
313 | } | ||
314 | |||
315 | printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, " | ||
316 | "using %dk, total %dk\n", | ||
317 | vesafb_fix.smem_start, info->screen_base, | ||
318 | size_remap/1024, size_total/1024); | ||
319 | printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n", | 306 | printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n", |
320 | vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, vesafb_fix.line_length, screen_info.pages); | 307 | vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, vesafb_fix.line_length, screen_info.pages); |
321 | 308 | ||
@@ -438,8 +425,7 @@ static int __init vesafb_probe(struct platform_device *dev) | |||
438 | int rc; | 425 | int rc; |
439 | 426 | ||
440 | /* Find the largest power-of-two */ | 427 | /* Find the largest power-of-two */ |
441 | while (temp_size & (temp_size - 1)) | 428 | temp_size = roundup_pow_of_two(temp_size); |
442 | temp_size &= (temp_size - 1); | ||
443 | 429 | ||
444 | /* Try and find a power of two to add */ | 430 | /* Try and find a power of two to add */ |
445 | do { | 431 | do { |
@@ -451,6 +437,34 @@ static int __init vesafb_probe(struct platform_device *dev) | |||
451 | } | 437 | } |
452 | #endif | 438 | #endif |
453 | 439 | ||
440 | switch (mtrr) { | ||
441 | case 1: /* uncachable */ | ||
442 | info->screen_base = ioremap_nocache(vesafb_fix.smem_start, vesafb_fix.smem_len); | ||
443 | break; | ||
444 | case 2: /* write-back */ | ||
445 | info->screen_base = ioremap_cache(vesafb_fix.smem_start, vesafb_fix.smem_len); | ||
446 | break; | ||
447 | case 3: /* write-combining */ | ||
448 | info->screen_base = ioremap_wc(vesafb_fix.smem_start, vesafb_fix.smem_len); | ||
449 | break; | ||
450 | case 4: /* write-through */ | ||
451 | default: | ||
452 | info->screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len); | ||
453 | break; | ||
454 | } | ||
455 | if (!info->screen_base) { | ||
456 | printk(KERN_ERR | ||
457 | "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n", | ||
458 | vesafb_fix.smem_len, vesafb_fix.smem_start); | ||
459 | err = -EIO; | ||
460 | goto err; | ||
461 | } | ||
462 | |||
463 | printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, " | ||
464 | "using %dk, total %dk\n", | ||
465 | vesafb_fix.smem_start, info->screen_base, | ||
466 | size_remap/1024, size_total/1024); | ||
467 | |||
454 | info->fbops = &vesafb_ops; | 468 | info->fbops = &vesafb_ops; |
455 | info->var = vesafb_defined; | 469 | info->var = vesafb_defined; |
456 | info->fix = vesafb_fix; | 470 | info->fix = vesafb_fix; |