video: fbdev: vesafb: only support MTRR_TYPE_WRCOMB
No other video driver uses MTRR types except for MTRR_TYPE_WRCOMB, the other MTRR types were implemented and supported here but with no real good reason. The ioremap() APIs are architecture agnostic and at least on x86 PAT is a new design that extends MTRRs and can replace it in a much cleaner way, where so long as the proper ioremap_wc() or variant API is used the right thing will be done behind the scenes. This is the only driver left using the other MTRR types -- and since there is no good reason for it now rip them out. Cc: Toshi Kani <toshi.kani@hp.com> Cc: Suresh Siddha <sbsiddha@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Juergen Gross <jgross@suse.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Dave Airlie <airlied@redhat.com> Cc: Antonino Daplas <adaplas@gmail.com> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Jingoo Han <jg1.han@samsung.com> Cc: Wolfram Sang <wsa@the-dreams.de> Cc: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
99e62ef2ed
commit
87b81762a8
|
@ -404,60 +404,30 @@ static int vesafb_probe(struct platform_device *dev)
|
||||||
* region already (FIXME) */
|
* region already (FIXME) */
|
||||||
request_region(0x3c0, 32, "vesafb");
|
request_region(0x3c0, 32, "vesafb");
|
||||||
|
|
||||||
|
if (mtrr == 3) {
|
||||||
#ifdef CONFIG_MTRR
|
#ifdef CONFIG_MTRR
|
||||||
if (mtrr) {
|
|
||||||
unsigned int temp_size = size_total;
|
unsigned int temp_size = size_total;
|
||||||
unsigned int type = 0;
|
int rc;
|
||||||
|
|
||||||
switch (mtrr) {
|
/* Find the largest power-of-two */
|
||||||
case 1:
|
temp_size = roundup_pow_of_two(temp_size);
|
||||||
type = MTRR_TYPE_UNCACHABLE;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
type = MTRR_TYPE_WRBACK;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
type = MTRR_TYPE_WRCOMB;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
type = MTRR_TYPE_WRTHROUGH;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
type = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type) {
|
/* Try and find a power of two to add */
|
||||||
int rc;
|
do {
|
||||||
|
rc = mtrr_add(vesafb_fix.smem_start, temp_size,
|
||||||
/* Find the largest power-of-two */
|
MTRR_TYPE_WRCOMB, 1);
|
||||||
temp_size = roundup_pow_of_two(temp_size);
|
temp_size >>= 1;
|
||||||
|
} while (temp_size >= PAGE_SIZE && rc == -EINVAL);
|
||||||
/* Try and find a power of two to add */
|
|
||||||
do {
|
|
||||||
rc = mtrr_add(vesafb_fix.smem_start, temp_size,
|
|
||||||
type, 1);
|
|
||||||
temp_size >>= 1;
|
|
||||||
} while (temp_size >= PAGE_SIZE && rc == -EINVAL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (mtrr) {
|
|
||||||
case 1: /* uncachable */
|
|
||||||
info->screen_base = ioremap_nocache(vesafb_fix.smem_start, vesafb_fix.smem_len);
|
|
||||||
break;
|
|
||||||
case 2: /* write-back */
|
|
||||||
info->screen_base = ioremap_cache(vesafb_fix.smem_start, vesafb_fix.smem_len);
|
|
||||||
break;
|
|
||||||
case 3: /* write-combining */
|
|
||||||
info->screen_base = ioremap_wc(vesafb_fix.smem_start, vesafb_fix.smem_len);
|
info->screen_base = ioremap_wc(vesafb_fix.smem_start, vesafb_fix.smem_len);
|
||||||
break;
|
} else {
|
||||||
case 4: /* write-through */
|
#ifdef CONFIG_MTRR
|
||||||
default:
|
if (mtrr && mtrr != 3)
|
||||||
|
WARN_ONCE(1, "Only MTRR_TYPE_WRCOMB (3) make sense\n");
|
||||||
|
#endif
|
||||||
info->screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len);
|
info->screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!info->screen_base) {
|
if (!info->screen_base) {
|
||||||
printk(KERN_ERR
|
printk(KERN_ERR
|
||||||
"vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
|
"vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
|
||||||
|
|
Loading…
Reference in New Issue