linux/drivers/video/fbdev
Luis R. Rodriguez 7d89a3cb15 drivers/video/fbdev/atyfb: Use arch_phys_wc_add() and ioremap_wc()
This driver uses strong UC for the MMIO region, and ioremap_wc()
for the framebuffer to whitelist for the WC MTRR that can be
changed to WC. On PAT systems we don't need the MTRR call so
just use arch_phys_wc_add() there, this lets us remove all those
ifdefs. Let's also be consistent and use ioremap_wc() for ATARI
as well.

There are a few motivations for this:

  a) Take advantage of PAT when available.

  b) Help bury MTRR code away, MTRR is architecture specific and
     on x86 it is being replaced by PAT.

  c) Help with the goal of eventually using _PAGE_CACHE_UC over
     _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit
     de33c442e titled "x86 PAT: fix performance drop for glx,
     use UC minus for ioremap(), ioremap_nocache() and
     pci_mmap_page_range()").

The conversion done is expressed by the following Coccinelle
SmPL patch, it additionally required manual intervention to
address all the ifdeffery and removal of redundant things which
arch_phys_wc_add() already addresses such as verbose message
about when MTRR fails and doing nothing when we didn't get an
MTRR:

	@ mtrr_found @
	expression index, base, size;
	@@

	-index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
	+index = arch_phys_wc_add(base, size);

	@ mtrr_rm depends on mtrr_found @
	expression mtrr_found.index, mtrr_found.base, mtrr_found.size;
	@@

	-mtrr_del(index, base, size);
	+arch_phys_wc_del(index);

	@ mtrr_rm_zero_arg depends on mtrr_found @
	expression mtrr_found.index;
	@@

	-mtrr_del(index, 0, 0);
	+arch_phys_wc_del(index);

	@ mtrr_rm_fb_info depends on mtrr_found @
	struct fb_info *info;
	expression mtrr_found.index;
	@@

	-mtrr_del(index, info->fix.smem_start, info->fix.smem_len);
	+arch_phys_wc_del(index);

	@ ioremap_replace_nocache depends on mtrr_found @
	struct fb_info *info;
	expression base, size;
	@@

	-info->screen_base = ioremap_nocache(base, size);
	+info->screen_base = ioremap_wc(base, size);

	@ ioremap_replace_default depends on mtrr_found @
	struct fb_info *info;
	expression base, size;
	@@

	-info->screen_base = ioremap(base, size);
	+info->screen_base = ioremap_wc(base, size);

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathias Krause <minipli@googlemail.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Suresh Siddha <sbsiddha@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Ville Syrjälä <syrjala@sci.fi>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: arnd@arndb.de
Cc: benh@kernel.crashing.org
Cc: dan.j.williams@intel.com
Cc: geert@linux-m68k.org
Cc: hch@lst.de
Cc: hmh@hmh.eng.br
Cc: linux-fbdev@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-pci@vger.kernel.org
Cc: mpe@ellerman.id.au
Cc: mst@redhat.com
Cc: ralf@linux-mips.org
Cc: ross.zwisler@linux.intel.com
Cc: stefan.bader@canonical.com
Cc: tj@kernel.org
Cc: ville.syrjala@linux.intel.com
Link: http://lkml.kernel.org/r/1436491499-3289-5-git-send-email-mcgrof@do-not-panic.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-07-21 10:47:05 +02:00
..
aty drivers/video/fbdev/atyfb: Use arch_phys_wc_add() and ioremap_wc() 2015-07-21 10:47:05 +02:00
core fbdev: remove the unnecessary includes of ppc specific header files 2015-03-17 20:04:32 +11:00
exynos Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
geode fbdev: geocode: remove unneeded NULL check 2015-01-13 13:29:22 +02:00
i810
intelfb video: fbdev: intelfb: delete double assignment 2014-08-26 15:53:34 +03:00
kyro
matrox video: fbdev: matrox: use c99 initializers in structures 2014-08-26 15:52:38 +03:00
mb862xx video: fbdev: mb862xx: drop owner assignment from platform_drivers 2014-10-20 16:21:52 +02:00
mbx video/mbx: indent some if statements 2014-07-01 13:32:30 +03:00
mmp video/mmpfb: allow modular build 2015-01-30 09:45:20 +02:00
msm msm: msm_fb: Move to using managed resources of kzalloc 2014-08-26 15:53:33 +03:00
nvidia fbdev: nvidia: remove the dependency on PPC_OF 2015-03-17 20:04:32 +11:00
omap video: fbdev: omap: drop owner assignment from platform_drivers 2014-10-20 16:21:54 +02:00
omap2 fbdev changes for v4.1 2015-04-20 15:16:25 -07:00
riva fbdev: riva: remove the dependency on PPC_OF 2015-03-17 20:04:32 +11:00
savage fbdev: savage: remove unused variable 2015-01-13 13:31:51 +02:00
sis video: fbdev-SIS: Deletion of unnecessary checks before the function call "pci_dev_put" 2014-12-04 16:16:01 +02:00
vermilion x86: Use new cache mode type in drivers/video/fbdev/vermilion 2014-11-16 11:04:25 +01:00
via fbdev: via/via_clock: fix sparse warning 2015-03-02 13:17:25 +02:00
68328fb.c video: 68328fb: remove check for CONFIG_FB_68328_INVERT 2014-06-24 10:55:13 +03:00
acornfb.c
acornfb.h
amba-clcd-versatile.c video: move Versatile CLCD helpers 2014-06-27 10:15:22 +02:00
amba-clcd.c video: ARM CLCD: Add missing error check for devm_kzalloc 2015-02-26 10:23:15 +02:00
amifb.c video/fbdev, asm/io.h: Remove ioremap_writethrough() 2015-06-07 15:28:57 +02:00
arcfb.c
arkfb.c video: fbdev: arkfb: suppress build warning 2014-12-04 15:41:18 +02:00
asiliantfb.c
atafb_iplan2p2.c
atafb_iplan2p4.c
atafb_iplan2p8.c
atafb_mfb.c
atafb_utils.h
atafb.c video/fbdev, asm/io.h: Remove ioremap_writethrough() 2015-06-07 15:28:57 +02:00
atafb.h
atmel_lcdfb.c Merge branch 'platform/remove_owner' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into driver-core-next 2014-11-03 19:53:56 -08:00
au1100fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
au1100fb.h MIPS: Alchemy: au1100fb: use clk framework 2014-07-30 14:10:39 +02:00
au1200fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
au1200fb.h
auo_k190x.c
auo_k190x.h
auo_k1900fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
auo_k1901fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
bf54x-lq043fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
bf537-lq035.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
bfin_adv7393fb.c fb: adv7393: add missing semicolon 2014-07-01 13:18:38 +03:00
bfin_adv7393fb.h
bfin-lq035q1-fb.c
bfin-t350mcqb-fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
broadsheetfb.c fbdev/broadsheetfb: fix memory leak 2015-01-13 15:13:45 +02:00
bt431.h
bt455.h
bw2.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
c2p_core.h
c2p_iplan2.c
c2p_planar.c
c2p.h
carminefb_regs.h
carminefb.c
carminefb.h
cg3.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
cg6.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
cg14.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
chipsfb.c fbdev: Remove __init from chips_hw_init() to fix build failure 2014-08-26 12:48:34 +03:00
cirrusfb.c
clps711x-fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
clps711xfb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
cobalt_lcdfb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
controlfb.c powerpc: Move Power Macintosh drivers to generic byteswappers 2015-03-23 14:29:40 +11:00
controlfb.h
cyber2000fb.c video: fbdev: cyber2000fb.c: use container_of to resolve cfb_info from fb_info 2014-09-30 13:06:01 +03:00
cyber2000fb.h
da8xx-fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
dnfb.c
edid.h
efifb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
ep93xx-fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
fb-puv3.c drivers/video/fbdev/fb-puv3.c: Add header files for function unifb_mmap 2014-05-23 13:51:10 +03:00
ffb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
fm2fb.c
fsl-diu-fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
g364fb.c
gbefb.c x86: Use new cache mode type in drivers/video/fbdev/gbefb.c 2014-11-16 11:04:25 +01:00
goldfishfb.c
grvga.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
gxt4500.c
hecubafb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
hgafb.c video: hgafb: remove unneeded comparison 2015-01-26 14:43:06 +02:00
hitfb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
hpfb.c video/fbdev, asm/io.h: Remove ioremap_writethrough() 2015-06-07 15:28:57 +02:00
hyperv_fb.c hyperv: hyperv_fb: match wait_for_completion_timeout return type 2015-03-10 14:37:46 +02:00
i740_reg.h
i740fb.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
igafb.c
imsttfb.c fbdev: imsttfb: remove the dependency on PPC_OF 2015-03-17 20:04:31 +11:00
imxfb.c video: fbdev: make of_device_id array const 2015-03-02 13:17:24 +02:00
jz4740_fb.c
Kconfig fbdev: kconfig: replace PPC_OF with PPC 2015-03-17 20:04:32 +11:00
leo.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
macfb.c
macmodes.c
macmodes.h
Makefile fbdev changes for 3.17 2014-08-08 18:09:33 -07:00
maxinefb.c
metronomefb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
mx3fb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
mxsfb.c fbdev: mxsfb: Add support for mx6sl and mx6sx 2014-11-06 16:41:36 +02:00
n411.c
neofb.c
nuc900fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
nuc900fb.h
ocfb.c video: ocfb: Fix data type warning 2015-01-13 12:53:25 +02:00
offb.c Revert "offb: Add palette hack for little endian" 2014-06-16 19:45:45 +10:00
p9100.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
platinumfb.c powerpc: Move Power Macintosh drivers to generic byteswappers 2015-03-23 14:29:40 +11:00
platinumfb.h
pm2fb.c
pm3fb.c fbdev: pm3fb: cleanup some confusing indenting 2015-03-10 14:47:09 +02:00
pmag-aa-fb.c
pmag-ba-fb.c
pmagb-b-fb.c
ps3fb.c
pvr2fb.c mm: gup: use get_user_pages_unlocked 2015-02-11 17:06:05 -08:00
pxa3xx-gcu.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
pxa3xx-gcu.h
pxa168fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
pxa168fb.h
pxafb.c video: fbdev: use msecs_to_jiffies for time conversions 2015-03-10 14:32:13 +02:00
pxafb.h
q40fb.c
s1d13xxxfb.c
s3c2410fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
s3c2410fb.h
s3c-fb.c More ACPI and power management updates for 3.19-rc1 2014-12-18 20:28:33 -08:00
s3fb.c video: fbdev: s3fb: suppress build warning 2014-12-04 15:41:18 +02:00
sa1100fb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
sa1100fb.h ARM: 8244/1: fbdev: sa1100fb: make use of device clock 2014-12-05 16:30:25 +00:00
sbuslib.c
sbuslib.h
sh7760fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
sh_mipi_dsi.c
sh_mobile_hdmi.c fbdev: sh_mobile_hdmi: Re-init regs before irq re-enable on resume 2014-09-30 13:42:13 +03:00
sh_mobile_lcdcfb.c fbdev: sh_mobile_lcdc: Fix destruction of uninitialized mutex 2015-04-07 16:24:15 +03:00
sh_mobile_lcdcfb.h
sh_mobile_meram.c More ACPI and power management updates for 3.19-rc1 2014-12-18 20:28:33 -08:00
simplefb.c simplefb: Fix build failure on Sparc 2015-01-13 13:25:16 +02:00
skeletonfb.c
sm501fb.c fbdev: sm501fb: use memset_io 2015-03-02 13:17:24 +02:00
smscufx.c video: smscufx: Deletion of unnecessary checks before the function call "vfree" 2014-12-04 16:16:01 +02:00
ssd1307fb.c fbdev: ssd1307fb: return proper error code if write command fails 2015-01-30 09:40:00 +02:00
sstfb.c
sticore.h
stifb.c video: fbdev: stifb.c: use container_of to resolve stifb_info from fb_info 2014-09-30 13:06:00 +03:00
sunxvr500.c
sunxvr1000.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
sunxvr2500.c
tcx.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
tdfxfb.c
tgafb.c
tmiofb.c
tridentfb.c
udlfb.c video: udlfb: Deletion of unnecessary checks before the function call "vfree" 2014-12-04 16:16:01 +02:00
uvesafb.c video: uvesafb: Deletion of an unnecessary check before the function call "platform_device_put" 2014-12-04 16:16:02 +02:00
valkyriefb.c video: fbdev: valkyriefb.c: use container_of to resolve fb_info_valkyrie from fb_info 2014-09-30 13:06:01 +03:00
valkyriefb.h
vesafb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
vfb.c
vga16fb.c
vt8500lcdfb.c video: vt8500lcdfb: remove unneeded continue 2015-01-13 13:35:04 +02:00
vt8500lcdfb.h
vt8623fb.c video: fbdev: vt8623fb: suppress build warning 2014-12-04 15:41:18 +02:00
w100fb.c
w100fb.h
wm8505fb_regs.h
wm8505fb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
wmt_ge_rops.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00
wmt_ge_rops.h
xen-fbfront.c xen: remove DEFINE_XENBUS_DRIVER() macro 2014-10-06 10:27:57 +01:00
xilinxfb.c video: fbdev: drop owner assignment from platform_drivers 2014-10-20 16:21:51 +02:00