From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:16:56
From: "Luis R. Rodriguez" <redacted>
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/aty/radeon_base.c | 29 ++++++-----------------------
drivers/video/fbdev/aty/radeonfb.h | 2 +-
2 files changed, 7 insertions(+), 24 deletions(-)
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:17:13
From: "Luis R. Rodriguez" <redacted>
This driver uses the same ioremap()'d area for the MTRR.
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: Rob Clark <redacted>
Cc: Daniel Vetter <redacted>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Julia Lawall <redacted>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/matrox/matroxfb_base.c | 36 +++++++++++-------------------
drivers/video/fbdev/matrox/matroxfb_base.h | 27 +---------------------
2 files changed, 14 insertions(+), 49 deletions(-)
@@ -2515,10 +2507,8 @@ module_param(noinit, int, 0);MODULE_PARM_DESC(noinit,"Disables W/SG/SD-RAM and bus interface initialization (0 or 1=do not initialize) (default=0)");module_param(memtype,int,0);MODULE_PARM_DESC(memtype,"Memory type for G200/G400 (see Documentation/fb/matroxfb.txt for explanation) (default=3 for G200, 0 for G400)");-#ifdef CONFIG_MTRRmodule_param(mtrr,int,0);MODULE_PARM_DESC(mtrr,"This speeds up video memory accesses (0=disabled or 1) (default=1)");-#endifmodule_param(sgram,int,0);MODULE_PARM_DESC(sgram,"Indicates that G100/G200/G400 has SGRAM memory (0=SDRAM, 1=SGRAM) (default=0)");module_param(inv24,int,0);
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:17:17
From: "Luis R. Rodriguez" <redacted>
This driver uses the same area for MTRR and ioremap().
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/nvidia/nv_type.h | 7 +------
drivers/video/fbdev/nvidia/nvidia.c | 37 ++++++------------------------------
2 files changed, 7 insertions(+), 37 deletions(-)
@@ -1372,20 +1368,9 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)par->FbStart=info->screen_base;-#ifdef CONFIG_MTRR-if(!nomtrr){-par->mtrr.vram=mtrr_add(nvidiafb_fix.smem_start,-par->RamAmountKBytes*1024,-MTRR_TYPE_WRCOMB,1);-if(par->mtrr.vram<0){-printk(KERN_ERRPFX"unable to setup MTRR\n");-}else{-par->mtrr.vram_valid=1;-/* let there be speed */-printk(KERN_INFOPFX"MTRR set to ON\n");-}-}-#endif /* CONFIG_MTRR */+if(!nomtrr)+par->wc_cookie=arch_phys_wc_add(nvidiafb_fix.smem_start,+par->RamAmountKBytes*1024);info->fbops=&nvidia_fb_ops;info->fix=nvidiafb_fix;
@@ -1501,10 +1480,8 @@ static int nvidiafb_setup(char *options)vram=simple_strtoul(this_opt+5,NULL,0);}elseif(!strncmp(this_opt,"backlight:",10)){backlight=simple_strtoul(this_opt+10,NULL,0);-#ifdef CONFIG_MTRR}elseif(!strncmp(this_opt,"nomtrr",6)){nomtrr=true;-#endif}elseif(!strncmp(this_opt,"fpdither:",9)){fpdither=simple_strtol(this_opt+9,NULL,0);}elseif(!strncmp(this_opt,"bpp:",4)){
@@ -1592,11 +1569,9 @@ MODULE_PARM_DESC(bpp, "pixel width in bits""(default=8)");module_param(reverse_i2c,int,0);MODULE_PARM_DESC(reverse_i2c,"reverse port assignment of the i2c bus");-#ifdef CONFIG_MTRRmodule_param(nomtrr,bool,false);MODULE_PARM_DESC(nomtrr,"Disables MTRR support (0 or 1=disabled) ""(default=0)");-#endifMODULE_AUTHOR("Antonino Daplas");MODULE_DESCRIPTION("Framebuffer driver for nVidia graphics chipset");
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:17:27
From: "Luis R. Rodriguez" <redacted>
This driver uses the same area for MTRR as for the ioremap().
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/sis/sis.h | 2 +-
drivers/video/fbdev/sis/sis_main.c | 27 ++++++---------------------
2 files changed, 7 insertions(+), 22 deletions(-)
@@ -4130,13 +4127,13 @@ static void sisfb_post_map_vram(struct sis_video_info *ivideo,if(*mapsize<(min<<20))return;-ivideo->video_vbase=ioremap(ivideo->video_base,(*mapsize));+ivideo->video_vbase=ioremap_wc(ivideo->video_base,(*mapsize));if(!ivideo->video_vbase){printk(KERN_ERR"sisfb: Unable to map maximum video RAM for size detection\n");(*mapsize)>>=1;-while((!(ivideo->video_vbase=ioremap(ivideo->video_base,(*mapsize))))){+while((!(ivideo->video_vbase=ioremap_wc(ivideo->video_base,(*mapsize))))){(*mapsize)>>=1;if((*mapsize)<(min<<20))break;
@@ -6186,7 +6183,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)gotoerror_2;}-ivideo->video_vbase=ioremap(ivideo->video_base,ivideo->video_size);+ivideo->video_vbase=ioremap_wc(ivideo->video_base,ivideo->video_size);ivideo->SiS_Pr.VideoMemoryAddress=ivideo->video_vbase;if(!ivideo->video_vbase){printk(KERN_ERR"sisfb: Fatal error: Unable to map framebuffer memory\n");
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:17:30
From: "Luis R. Rodriguez" <redacted>
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Paul Mackerras <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/aty/aty128fb.c | 36 ++++++------------------------------
1 file changed, 6 insertions(+), 30 deletions(-)
@@ -456,9 +449,7 @@ struct aty128fb_par {u32vram_size;/* onboard video ram */intchip_gen;conststructaty128_meminfo*mem;/* onboard mem info */-#ifdef CONFIG_MTRR-struct{intvram;intvram_valid;}mtrr;-#endif+intwc_cookie;intblitter_may_be_busy;intfifo_slots;/* free slots in FIFO (64 max) */
@@ -1725,12 +1716,10 @@ static int aty128fb_setup(char *options)#endifcontinue;}-#ifdef CONFIG_MTRRif(!strncmp(this_opt,"nomtrr",6)){mtrr=0;continue;}-#endif#ifdef CONFIG_PPC_PMAC/* vmode and cmode deprecated */if(!strncmp(this_opt,"vmode:",6)){
@@ -2133,7 +2122,7 @@ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent)par->vram_size=aty_ld_le32(CNFG_MEMSIZE)&0x03FFFFFF;/* Virtualize the framebuffer */-info->screen_base=ioremap(fb_addr,par->vram_size);+info->screen_base=ioremap_wc(fb_addr,par->vram_size);if(!info->screen_base)gotoerr_unmap_out;
@@ -2170,15 +2159,9 @@ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if(!aty128_init(pdev,ent))gotoerr_out;-#ifdef CONFIG_MTRR-if(mtrr){-par->mtrr.vram=mtrr_add(info->fix.smem_start,-par->vram_size,MTRR_TYPE_WRCOMB,1);-par->mtrr.vram_valid=1;-/* let there be speed */-printk(KERN_INFO"aty128fb: Rage128 MTRR set to ON\n");-}-#endif /* CONFIG_MTRR */+if(mtrr)+par->wc_cookie=arch_phys_wc_add(info->fix.smem_start,+par->vram_size);return0;err_out:
@@ -2625,8 +2604,5 @@ MODULE_DESCRIPTION("FBDev driver for ATI Rage128 / Pro cards");MODULE_LICENSE("GPL");module_param(mode_option,charp,0);MODULE_PARM_DESC(mode_option,"Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");-#ifdef CONFIG_MTRRmodule_param_named(nomtrr,mtrr,invbool,0);MODULE_PARM_DESC(nomtrr,"bool: Disable MTRR support (0 or 1=disabled) (default=0)");-#endif-
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:17:38
From: "Luis R. Rodriguez" <redacted>
This driver uses the same area for MTRR as for the ioremap().
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Jingoo Han <redacted>
Cc: Dan Carpenter <redacted>
Cc: Rob Clark <redacted>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/pm3fb.c | 30 ++++++------------------------
1 file changed, 6 insertions(+), 24 deletions(-)
@@ -76,7 +69,7 @@ struct pm3_par {u32video;/* video flags before blanking */u32base;/* screen base in 128 bits unit */u32palette[16];-intmtrr_handle;+intwc_cookie;};/*
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:17:44
From: "Luis R. Rodriguez" <redacted>
This driver uses the same area for MTRR as for the ioremap().
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/riva/fbdev.c | 39 +++++++--------------------------------
drivers/video/fbdev/riva/rivafb.h | 4 +---
2 files changed, 8 insertions(+), 35 deletions(-)
@@ -2010,28 +2005,18 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent)rivafb_fix.smem_len=riva_get_memlen(default_par)*1024;default_par->dclk_max=riva_get_maxdclk(default_par)*1000;-info->screen_base=ioremap(rivafb_fix.smem_start,-rivafb_fix.smem_len);+info->screen_base=ioremap_wc(rivafb_fix.smem_start,+rivafb_fix.smem_len);if(!info->screen_base){printk(KERN_ERRPFX"cannot ioremap FB base\n");ret=-EIO;gotoerr_iounmap_pramin;}-#ifdef CONFIG_MTRR-if(!nomtrr){-default_par->mtrr.vram=mtrr_add(rivafb_fix.smem_start,-rivafb_fix.smem_len,-MTRR_TYPE_WRCOMB,1);-if(default_par->mtrr.vram<0){-printk(KERN_ERRPFX"unable to setup MTRR\n");-}else{-default_par->mtrr.vram_valid=1;-/* let there be speed */-printk(KERN_INFOPFX"RIVA MTRR set to ON\n");-}-}-#endif /* CONFIG_MTRR */+if(!nomtrr)+default_par->wc_cookie+arch_phys_wc_add(rivafb_fix.smem_start,+rivafb_fix.smem_len);info->fbops=&riva_fb_ops;info->fix=rivafb_fix;
@@ -2150,10 +2129,8 @@ static int rivafb_setup(char *options)flatpanel=1;}elseif(!strncmp(this_opt,"backlight:",10)){backlight=simple_strtoul(this_opt+10,NULL,0);-#ifdef CONFIG_MTRR}elseif(!strncmp(this_opt,"nomtrr",6)){nomtrr=1;-#endif}elseif(!strncmp(this_opt,"strictmode",10)){strictmode=1;}elseif(!strncmp(this_opt,"noaccel",7)){
@@ -2209,10 +2186,8 @@ module_param(flatpanel, int, 0);MODULE_PARM_DESC(flatpanel,"Enables experimental flat panel support for some chipsets. (0 or 1=enabled) (default=0)");module_param(forceCRTC,int,0);MODULE_PARM_DESC(forceCRTC,"Forces usage of a particular CRTC in case autodetection fails. (0 or 1) (default=autodetect)");-#ifdef CONFIG_MTRRmodule_param(nomtrr,bool,0);MODULE_PARM_DESC(nomtrr,"Disables MTRR support (0 or 1=disabled) (default=0)");-#endifmodule_param(strictmode,bool,0);MODULE_PARM_DESC(strictmode,"Only use video modes from EDID");
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:17:48
From: "Luis R. Rodriguez" <redacted>
This driver uses the same area for MTRR as for the ioremap().
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Rob Clark <redacted>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/tdfxfb.c | 41 ++++++-----------------------------------
include/video/tdfx.h | 2 +-
2 files changed, 7 insertions(+), 36 deletions(-)
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:17:51
From: "Luis R. Rodriguez" <redacted>
The driver doesn't use mtrr_add() or arch_phys_wc_add() but
since we know the framebuffer is isolated already on an
ioremap() we can take advantage of write combining for
performance where possible.
In this case there are a few motivations for this:
a) Take advantage of PAT when available
b) 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()")
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Jingoo Han <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-geode@lists.infradead.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/geode/gxfb_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:18:29
From: "Luis R. Rodriguez" <redacted>
The driver doesn't use mtrr_add() or arch_phys_wc_add() but
since we know the framebuffer is isolated already on an
ioremap() we can take advantage of write combining for
performance where possible.
In this case there are a few motivations for this:
a) Take advantage of PAT when available
b) 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()")
Cc: Nicolas Ferre <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/atmel_lcdfb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:18:57
From: "Luis R. Rodriguez" <redacted>
This driver uses the same area for MTRR as for the ioremap().
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Rob Clark <redacted>
Cc: Jingoo Han <redacted>
Cc: Daniel Vetter <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/pm2fb.c | 31 +++++--------------------------
1 file changed, 5 insertions(+), 26 deletions(-)
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:19:19
From: "Luis R. Rodriguez" <redacted>
The same area used for MTRR is used for the ioremap() area.
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/i810/i810.h | 3 +--
drivers/video/fbdev/i810/i810_main.c | 11 +++++++----
drivers/video/fbdev/i810/i810_main.h | 26 --------------------------
3 files changed, 8 insertions(+), 32 deletions(-)
@@ -60,32 +60,6 @@ static inline void flush_cache(void)#define flush_cache() do { } while(0)#endif -#ifdef CONFIG_MTRR--#include<asm/mtrr.h>--staticinlinevoidset_mtrr(structi810fb_par*par)-{-par->mtrr_reg=mtrr_add((u32)par->aperture.physical,-par->aperture.size,MTRR_TYPE_WRCOMB,1);-if(par->mtrr_reg<0){-printk(KERN_ERR"set_mtrr: unable to set MTRR\n");-return;-}-par->dev_flags|=HAS_MTRR;-}-staticinlinevoidunset_mtrr(structi810fb_par*par)-{-if(par->dev_flags&HAS_MTRR)-mtrr_del(par->mtrr_reg,(u32)par->aperture.physical,-par->aperture.size);-}-#else-#define set_mtrr(x) printk("set_mtrr: MTRR is disabled in the kernel\n")--#define unset_mtrr(x) do { } while (0)-#endif /* CONFIG_MTRR */-#ifdef CONFIG_FB_I810_GTF#define IS_DVT (0)#else
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:20:06
From: "Luis R. Rodriguez" <redacted>
This driver uses the same area for MTRR as for the ioremap().
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/savage/savagefb.h | 4 +---
drivers/video/fbdev/savage/savagefb_driver.c | 17 +++--------------
2 files changed, 4 insertions(+), 17 deletions(-)
@@ -1775,7 +1771,7 @@ static int savage_map_video(struct fb_info *info, int video_len)par->video.pbase=pci_resource_start(par->pcidev,resource);par->video.len=video_len;-par->video.vbase=ioremap(par->video.pbase,par->video.len);+par->video.vbase=ioremap_wc(par->video.pbase,par->video.len);if(!par->video.vbase){printk("savagefb: unable to map screen memory\n");
@@ -1787,11 +1783,7 @@ static int savage_map_video(struct fb_info *info, int video_len)info->fix.smem_start=par->video.pbase;info->fix.smem_len=par->video.len-par->cob_size;info->screen_base=par->video.vbase;--#ifdef CONFIG_MTRR-par->video.mtrr=mtrr_add(par->video.pbase,video_len,-MTRR_TYPE_WRCOMB,1);-#endif+par->video.wc_cookie=arch_phys_wc_add(par->video.pbase,video_len);/* Clear framebuffer, it's all white in memory after boot */memset_io(par->video.vbase,0,par->video.len);
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:20:36
From: "Luis R. Rodriguez" <redacted>
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Jingoo Han <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/neofb.c | 26 +++++++-------------------
include/video/neomagic.h | 5 +----
2 files changed, 8 insertions(+), 23 deletions(-)
@@ -1710,6 +1705,7 @@ static int neo_map_video(struct fb_info *info, struct pci_dev *dev,intvideo_len){//unsigned long addr;+structneofb_par*par=info->par;DBG("neo_map_video");
@@ -1723,7 +1719,7 @@ static int neo_map_video(struct fb_info *info, struct pci_dev *dev,}info->screen_base-ioremap(info->fix.smem_start,info->fix.smem_len);+ioremap_wc(info->fix.smem_start,info->fix.smem_len);if(!info->screen_base){printk("neofb: unable to map screen memory\n");release_mem_region(info->fix.smem_start,
@@ -1733,11 +1729,8 @@ static int neo_map_video(struct fb_info *info, struct pci_dev *dev,printk(KERN_INFO"neofb: mapped framebuffer at %p\n",info->screen_base);-#ifdef CONFIG_MTRR-((structneofb_par*)(info->par))->mtrr-mtrr_add(info->fix.smem_start,pci_resource_len(dev,0),-MTRR_TYPE_WRCOMB,1);-#endif+par->wc_cookie=arch_phys_wc_add(info->fix.smem_start,+pci_resource_len(dev,0));/* Clear framebuffer, it's all white in memory after boot */memset_io(info->screen_base,0,info->fix.smem_len);
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:20:40
From: "Luis R. Rodriguez" <redacted>
Although this driver gives the framebuffer layer a different
size for the framebuffer it uses the entire aperture PCI BAR
size for the MTRR. Since the framebuffer is included in that
range and MTRR was used on the entire PCI BAR WC will have
been preferred on that range as well. This propagates the
WC preference on the same entire PCI BAR.
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Maik Broemme <redacted>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/intelfb/intelfb.h | 4 +---
drivers/video/fbdev/intelfb/intelfbdrv.c | 38 ++++----------------------------
2 files changed, 5 insertions(+), 37 deletions(-)
@@ -285,9 +285,7 @@ struct intelfb_info {/* use a gart reserved fb mem */u8fbmem_gart;-/* mtrr support */-intmtrr_reg;-u32has_mtrr;+intwc_cookie;/* heap data */structintelfb_heap_dataaperture;
@@ -411,33 +407,6 @@ module_init(intelfb_init);module_exit(intelfb_exit);/***************************************************************-*mtrrsupportfunctions*-***************************************************************/--#ifdef CONFIG_MTRR-staticinlinevoidset_mtrr(structintelfb_info*dinfo)-{-dinfo->mtrr_reg=mtrr_add(dinfo->aperture.physical,-dinfo->aperture.size,MTRR_TYPE_WRCOMB,1);-if(dinfo->mtrr_reg<0){-ERR_MSG("unable to set MTRR\n");-return;-}-dinfo->has_mtrr=1;-}-staticinlinevoidunset_mtrr(structintelfb_info*dinfo)-{-if(dinfo->has_mtrr)-mtrr_del(dinfo->mtrr_reg,dinfo->aperture.physical,-dinfo->aperture.size);-}-#else-#define set_mtrr(x) WRN_MSG("MTRR is disabled in the kernel\n")--#define unset_mtrr(x) do { } while (0)-#endif /* CONFIG_MTRR */--/****************************************************************driverinit/cleanup****************************************************************/
@@ -675,7 +644,7 @@ static int intelfb_pci_register(struct pci_dev *pdev,/* Allocate memories (which aren't stolen) *//* Map the fb and MMIO regions *//* ioremap only up to the end of used aperture */-dinfo->aperture.virtual=(u8__iomem*)ioremap_nocache+dinfo->aperture.virtual=(u8__iomem*)ioremap_wc(dinfo->aperture.physical,((offset+dinfo->fb.offset)<<12)+dinfo->fb.size);if(!dinfo->aperture.virtual){
From: Luis R. Rodriguez <hidden> Date: 2015-04-21 20:23:29
From: "Luis R. Rodriguez" <redacted>
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.
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 its 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 #ifdery 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);
Generated-by: Coccinelle SmPL
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Jingoo Han <redacted>
Cc: Daniel Vetter <redacted>
Cc: Masanari Iida <redacted>
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/gbefb.c | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
@@ -1176,8 +1173,8 @@ static int gbefb_probe(struct platform_device *p_dev)if(gbe_mem_phys){/* memory was allocated at boot time */-gbe_mem=devm_ioremap_nocache(&p_dev->dev,gbe_mem_phys,-gbe_mem_size);+gbe_mem=devm_ioremap_wc(&p_dev->dev,gbe_mem_phys,+gbe_mem_size);if(!gbe_mem){printk(KERN_ERR"gbefb: couldn't map framebuffer\n");ret=-ENOMEM;
@@ -1188,8 +1185,8 @@ static int gbefb_probe(struct platform_device *p_dev)}else{/* try to allocate memory with the classical allocator*thishashighchancetofailonlowmemorymachines*/-gbe_mem=dma_alloc_coherent(NULL,gbe_mem_size,&gbe_dma_addr,-GFP_KERNEL);+gbe_mem=dma_alloc_writecombine(NULL,gbe_mem_size,+&gbe_dma_addr,GFP_KERNEL);if(!gbe_mem){printk(KERN_ERR"gbefb: couldn't allocate framebuffer memory\n");ret=-ENOMEM;
@@ -1199,10 +1196,7 @@ static int gbefb_probe(struct platform_device *p_dev)gbe_mem_phys=(unsignedlong)gbe_dma_addr;}-#ifdef CONFIG_X86-info->wc_cookie=mtrr_add(gbe_mem_phys,gbe_mem_size,-MTRR_TYPE_WRCOMB,1);-#endif+info->wc_cookie=arch_phys_wc_add(gbe_mem_phys,gbe_mem_size);/* map framebuffer memory into tiles table */for(i=0;i<(gbe_mem_size>>TILE_SHIFT);i++)
@@ -1242,10 +1236,7 @@ static int gbefb_probe(struct platform_device *p_dev)return0;out_gbe_unmap:-#ifdef CONFIG_MTRR-if(info->wc_cookie>=0)-mtrr_del(info->wc_cookie,0,0);-#endif+arch_phys_wc_del(info->wc_cookie);if(gbe_dma_addr)dma_free_coherent(NULL,gbe_mem_size,gbe_mem,gbe_mem_phys);out_tiles_free:
@@ -1265,10 +1256,7 @@ static int gbefb_remove(struct platform_device* p_dev)unregister_framebuffer(info);gbe_turn_off();-#ifdef CONFIG_MTRR-if(info->wc_cookie>=0)-mtrr_del(info->wc_cookie,0,0);-#endif+arch_phys_wc_del(info->wc_cookie);if(gbe_dma_addr)dma_free_coherent(NULL,gbe_mem_size,gbe_mem,gbe_mem_phys);dma_free_coherent(NULL,GBE_TLB_SIZE*sizeof(uint16_t),
From: Nicolas Ferre <hidden> Date: 2015-04-22 07:35:08
Le 21/04/2015 22:16, Luis R. Rodriguez a écrit :
From: "Luis R. Rodriguez" <redacted>
The driver doesn't use mtrr_add() or arch_phys_wc_add() but
since we know the framebuffer is isolated already on an
ioremap() we can take advantage of write combining for
performance where possible.
In this case there are a few motivations for this:
a) Take advantage of PAT when available
b) 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()")
Cc: Nicolas Ferre <redacted>
Seems okay:
Acked-by: Nicolas Ferre <redacted>
Thanks for having taking care of atmel_lcdfb driver.
Bye,
quoted hunk
Cc: Suresh Siddha <redacted>
Cc: Ingo Molnar <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <redacted>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Cc: Tomi Valkeinen <redacted>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <redacted>
---
drivers/video/fbdev/atmel_lcdfb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -2515,10 +2507,8 @@ module_param(noinit, int, 0);MODULE_PARM_DESC(noinit,"Disables W/SG/SD-RAM and bus interface initialization (0 or 1=do not initialize) (default=0)");module_param(memtype,int,0);MODULE_PARM_DESC(memtype,"Memory type for G200/G400 (see Documentation/fb/matroxfb.txt for explanation) (default=3 for G200, 0 for G400)");-#ifdef CONFIG_MTRRmodule_param(mtrr,int,0);MODULE_PARM_DESC(mtrr,"This speeds up video memory accesses (0=disabled or 1) (default=1)");-#endifmodule_param(sgram,int,0);MODULE_PARM_DESC(sgram,"Indicates that G100/G200/G400 has SGRAM memory (0=SDRAM, 1=SGRAM) (default=0)");module_param(inv24,int,0);
Glad you asked. Technically all framebuffer drivers will have
the fb_info and they *should* fill this properly with the base
and length. More on this below though.
Note: when I mention mtrr_add() I mean arch_phys_wc_add() as that
is what we have been changing the drivers to over the years and in
this series as well. Likewise for mtrr_del() there is arch_phys_wc_del(),
but since you might be revieiwng the code with mtrr_add() figured I'd
mention the current state of affairs prior to this set of series'
changes.
*Ideally* when the mtrr_add() or mtrr_del() call is made on framebuffer drivers
we'd be able to use info->fix.smem_start, info->fix.smem_len for those call's
purposes, where info is struct fb_info *info. I however did not find that to be
the case for all framebuffer device drivers, but it does not mean its not
possible. Even if its not possible for all framebuffer device drivers quite a
few do fall under this category and as such once all were vetted in grammar
form (maybe another cleanup on top of this series) I figured we could have
register_framebuffer() do the mtrr_add() call for drivers that need it by
simply setting a flag on a struct passed, likewise if such flag is set we'd
have the framebuffer core do the mtrr_del() later upon deregistration. I
considered doing this as another series but ran out of steam.
The only thing with this also though is we have DRM drivers and they have the DRM
core doing the mtrr stuff for them but I failed to complete the review there
and if we can just unify things for all framebuffer / DRM drivers I think that'd
be best, but it was also not clear if we want or if this is worth doing. Since
mtrr stuff is low hanging fruit and its all legacy stuff I didn't
bother to pursue more -- but in terms of grammar and cleanup there sure is
quite a bit of room left for love here. For a unified mtrr set of calls for
both framebuffer / DRM drivers it may be good to get guidance from fbdev / DRM
developers.
I hinted towards this on my original cover letter on the first version of
this series, see section d):
http://article.gmane.org/gmane.linux.kernel/1913979
BTW what I mean by "option" on that d) section of that cover letter I
mean all the driver string options passed to the driver, see matroxfb_setup()
for example, there is an option for mtrr.
Luis
From: Luis R. Rodriguez <hidden> Date: 2015-04-29 19:18:06
On Tue, Apr 21, 2015 at 1:16 PM, Luis R. Rodriguez
[off-list ref] wrote:
From: "Luis R. Rodriguez" <redacted>
This series addresses simple changes to framebuffer drivers to use
arch_phys_wc_add() and ioremap_wc() as well as fixing gbefb to add
missing mtrr_del() calls. These changes are pretty straight forward.
Luis R. Rodriguez (17):
video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: gbefb: add missing mtrr_del() calls
video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc()
video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer
video: fbdev: geode gxfb: use ioremap_wc() for framebuffer
Hey folks, these are all pretty straight forward, can anyone take them?
Luis
From: Tomi Valkeinen <hidden> Date: 2015-05-04 10:33:34
On 29/04/15 22:18, Luis R. Rodriguez wrote:
On Tue, Apr 21, 2015 at 1:16 PM, Luis R. Rodriguez
[off-list ref] wrote:
quoted
From: "Luis R. Rodriguez" <redacted>
This series addresses simple changes to framebuffer drivers to use
arch_phys_wc_add() and ioremap_wc() as well as fixing gbefb to add
missing mtrr_del() calls. These changes are pretty straight forward.
Luis R. Rodriguez (17):
video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: gbefb: add missing mtrr_del() calls
video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc()
video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer
video: fbdev: geode gxfb: use ioremap_wc() for framebuffer
Hey folks, these are all pretty straight forward, can anyone take them?
I can take these to fbdev tree. Unfortunately I'm not familiar with x86
nor mtrr, so I can't really say much about the patches themselves.
Tomi
From: Luis R. Rodriguez <hidden> Date: 2015-05-05 00:22:28
On Mon, May 04, 2015 at 01:33:34PM +0300, Tomi Valkeinen wrote:
On 29/04/15 22:18, Luis R. Rodriguez wrote:
quoted
On Tue, Apr 21, 2015 at 1:16 PM, Luis R. Rodriguez
[off-list ref] wrote:
quoted
From: "Luis R. Rodriguez" <redacted>
This series addresses simple changes to framebuffer drivers to use
arch_phys_wc_add() and ioremap_wc() as well as fixing gbefb to add
missing mtrr_del() calls. These changes are pretty straight forward.
Luis R. Rodriguez (17):
video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: gbefb: add missing mtrr_del() calls
video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc()
video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer
video: fbdev: geode gxfb: use ioremap_wc() for framebuffer
Hey folks, these are all pretty straight forward, can anyone take them?
I can take these to fbdev tree.
That'd be great!
Unfortunately I'm not familiar with x86
nor mtrr, so I can't really say much about the patches themselves.
Boris or Andy, I think you guy are more active from the x86 side,
a secondary Reviewed-by on this series other my own SOB would be
appreciated.
Luis
From: Andy Lutomirski <luto@amacapital.net> Date: 2015-05-05 13:47:31
On Mon, May 4, 2015 at 3:33 AM, Tomi Valkeinen [off-list ref] wrote:
On 29/04/15 22:18, Luis R. Rodriguez wrote:
quoted
On Tue, Apr 21, 2015 at 1:16 PM, Luis R. Rodriguez
[off-list ref] wrote:
quoted
From: "Luis R. Rodriguez" <redacted>
This series addresses simple changes to framebuffer drivers to use
arch_phys_wc_add() and ioremap_wc() as well as fixing gbefb to add
missing mtrr_del() calls. These changes are pretty straight forward.
Luis R. Rodriguez (17):
video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: gbefb: add missing mtrr_del() calls
video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc()
video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer
video: fbdev: geode gxfb: use ioremap_wc() for framebuffer
Hey folks, these are all pretty straight forward, can anyone take them?
I can take these to fbdev tree. Unfortunately I'm not familiar with x86
nor mtrr, so I can't really say much about the patches themselves.
I'm on vacation and there's no way I'll be able to usefully review
these in the next two weeks. I can describe what's going on in case
it helps:
On x86 there are two ways to get a write-combining MMIO mapping. The
sane way is ioremap_wc, and the ridiculous way is mtrr_add.
ioremap_wc does exactly what it appears to do, whereas mtrr_add acts
on physical addresses, requires power-of-two alignment, and is
unreliable.
On all recent hardware, ioremap_wc works, and mtrr_add is problematic
on all hardware even if it often works. The silly thing is that
mtrr_add pokes at the registers it uses even on hardware with working
ioremap_wc. This causes problems (those resources are a very limited
resource).
The solution I came up with a couple years ago is a new API
arch_phys_wc_add. It is a hint that a physical address range should
be write-combining. On hardware with working ioremap_wc, it's a
no-op. On x86 hardware without working ioremap_wc, it just calls
mtrr_add.
The upshot is that changing mtrr_add with a WC type to
arch_phys_wc_add is OK as long as the driver also uses ioremap_wc or
similar _wc APIs. Once everything has been converted, we can unexport
mtrr_add, which will have all kinds of benefits.
--Andy
From: Luis R. Rodriguez <hidden> Date: 2015-05-14 14:26:45
On Tue, May 05, 2015 at 06:47:31AM -0700, Andy Lutomirski wrote:
On Mon, May 4, 2015 at 3:33 AM, Tomi Valkeinen [off-list ref] wrote:
quoted
On 29/04/15 22:18, Luis R. Rodriguez wrote:
quoted
On Tue, Apr 21, 2015 at 1:16 PM, Luis R. Rodriguez
[off-list ref] wrote:
quoted
From: "Luis R. Rodriguez" <redacted>
This series addresses simple changes to framebuffer drivers to use
arch_phys_wc_add() and ioremap_wc() as well as fixing gbefb to add
missing mtrr_del() calls. These changes are pretty straight forward.
Luis R. Rodriguez (17):
video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: gbefb: add missing mtrr_del() calls
video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc()
video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer
video: fbdev: geode gxfb: use ioremap_wc() for framebuffer
Hey folks, these are all pretty straight forward, can anyone take them?
I can take these to fbdev tree. Unfortunately I'm not familiar with x86
nor mtrr, so I can't really say much about the patches themselves.
I'm on vacation and there's no way I'll be able to usefully review
these in the next two weeks. I can describe what's going on in case
it helps:
On x86 there are two ways to get a write-combining MMIO mapping. The
sane way is ioremap_wc, and the ridiculous way is mtrr_add.
ioremap_wc does exactly what it appears to do, whereas mtrr_add acts
on physical addresses, requires power-of-two alignment, and is
unreliable.
On all recent hardware, ioremap_wc works, and mtrr_add is problematic
on all hardware even if it often works. The silly thing is that
mtrr_add pokes at the registers it uses even on hardware with working
ioremap_wc. This causes problems (those resources are a very limited
resource).
The solution I came up with a couple years ago is a new API
arch_phys_wc_add. It is a hint that a physical address range should
be write-combining. On hardware with working ioremap_wc, it's a
no-op. On x86 hardware without working ioremap_wc, it just calls
mtrr_add.
The upshot is that changing mtrr_add with a WC type to
arch_phys_wc_add is OK as long as the driver also uses ioremap_wc or
similar _wc APIs. Once everything has been converted, we can unexport
mtrr_add, which will have all kinds of benefits.
Tomi,
Any chance you can consider this series again? I realize you say you are
not familiar with MTRR but given its prevalence use on framebuffer device
drivers and since you are a framebuffer subsystem maintainer I think its
perhaps fair to ask one of you become familiar with this stuff, or ask
questions if there are any. If its of any help this patch which adds
ioremap_uc() already got merged and the logic to phase MTRR is described
there too:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?idäb6be33c28923d8cde53023e0888b1c5d1a9027
That patch won't even be needed on this series, this series happens to be
straight forward: if you just ioremap_nocache() once and use mtrr_add()
then conver over to ioremap_wc() and use arch_phys_wc_add(). If it already
used ioremap_wc() just convert over from mtrr_add() to arch_phys_wc_add()
Not sure if you will get an Acked-by by x86 folks on this series as they
are busy, but I'm adding bp and hpa just in case.
Luis
From: Luis R. Rodriguez <hidden> Date: 2015-05-19 17:58:02
On Thu, May 14, 2015 at 04:26:45PM +0200, Luis R. Rodriguez wrote:
On Tue, May 05, 2015 at 06:47:31AM -0700, Andy Lutomirski wrote:
quoted
On Mon, May 4, 2015 at 3:33 AM, Tomi Valkeinen [off-list ref] wrote:
quoted
On 29/04/15 22:18, Luis R. Rodriguez wrote:
quoted
On Tue, Apr 21, 2015 at 1:16 PM, Luis R. Rodriguez
[off-list ref] wrote:
quoted
From: "Luis R. Rodriguez" <redacted>
This series addresses simple changes to framebuffer drivers to use
arch_phys_wc_add() and ioremap_wc() as well as fixing gbefb to add
missing mtrr_del() calls. These changes are pretty straight forward.
Luis R. Rodriguez (17):
video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: gbefb: add missing mtrr_del() calls
video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc()
video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer
video: fbdev: geode gxfb: use ioremap_wc() for framebuffer
Hey folks, these are all pretty straight forward, can anyone take them?
I can take these to fbdev tree. Unfortunately I'm not familiar with x86
nor mtrr, so I can't really say much about the patches themselves.
I'm on vacation and there's no way I'll be able to usefully review
these in the next two weeks. I can describe what's going on in case
it helps:
On x86 there are two ways to get a write-combining MMIO mapping. The
sane way is ioremap_wc, and the ridiculous way is mtrr_add.
ioremap_wc does exactly what it appears to do, whereas mtrr_add acts
on physical addresses, requires power-of-two alignment, and is
unreliable.
On all recent hardware, ioremap_wc works, and mtrr_add is problematic
on all hardware even if it often works. The silly thing is that
mtrr_add pokes at the registers it uses even on hardware with working
ioremap_wc. This causes problems (those resources are a very limited
resource).
The solution I came up with a couple years ago is a new API
arch_phys_wc_add. It is a hint that a physical address range should
be write-combining. On hardware with working ioremap_wc, it's a
no-op. On x86 hardware without working ioremap_wc, it just calls
mtrr_add.
The upshot is that changing mtrr_add with a WC type to
arch_phys_wc_add is OK as long as the driver also uses ioremap_wc or
similar _wc APIs. Once everything has been converted, we can unexport
mtrr_add, which will have all kinds of benefits.
Tomi,
Any chance you can consider this series again? I realize you say you are
not familiar with MTRR but given its prevalence use on framebuffer device
drivers and since you are a framebuffer subsystem maintainer I think its
perhaps fair to ask one of you become familiar with this stuff, or ask
questions if there are any. If its of any help this patch which adds
ioremap_uc() already got merged and the logic to phase MTRR is described
there too:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?idäb6be33c28923d8cde53023e0888b1c5d1a9027
That patch won't even be needed on this series, this series happens to be
straight forward: if you just ioremap_nocache() once and use mtrr_add()
then conver over to ioremap_wc() and use arch_phys_wc_add(). If it already
used ioremap_wc() just convert over from mtrr_add() to arch_phys_wc_add()
Not sure if you will get an Acked-by by x86 folks on this series as they
are busy, but I'm adding bp and hpa just in case.
Hey folks please let me know how I can be of any help with this. Not sure
what else I can do here to help further.
Luis
From: Dave Airlie <airlied@gmail.com> Date: 2015-05-19 22:17:11
On 20 May 2015 at 03:58, Luis R. Rodriguez [off-list ref] wrote:
On Thu, May 14, 2015 at 04:26:45PM +0200, Luis R. Rodriguez wrote:
quoted
On Tue, May 05, 2015 at 06:47:31AM -0700, Andy Lutomirski wrote:
quoted
On Mon, May 4, 2015 at 3:33 AM, Tomi Valkeinen [off-list ref] wrote:
quoted
On 29/04/15 22:18, Luis R. Rodriguez wrote:
quoted
On Tue, Apr 21, 2015 at 1:16 PM, Luis R. Rodriguez
[off-list ref] wrote:
quoted
From: "Luis R. Rodriguez" <redacted>
This series addresses simple changes to framebuffer drivers to use
arch_phys_wc_add() and ioremap_wc() as well as fixing gbefb to add
missing mtrr_del() calls. These changes are pretty straight forward.
Luis R. Rodriguez (17):
video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: gbefb: add missing mtrr_del() calls
video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc()
video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer
video: fbdev: geode gxfb: use ioremap_wc() for framebuffer
These 17 are all
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tomi, can you please take them via the fbdev tree?
Dave.
From: Tomi Valkeinen <hidden> Date: 2015-05-20 08:45:39
Hi,
On 20/05/15 01:17, Dave Airlie wrote:
On 20 May 2015 at 03:58, Luis R. Rodriguez [off-list ref] wrote:
quoted
On Thu, May 14, 2015 at 04:26:45PM +0200, Luis R. Rodriguez wrote:
quoted
On Tue, May 05, 2015 at 06:47:31AM -0700, Andy Lutomirski wrote:
quoted
On Mon, May 4, 2015 at 3:33 AM, Tomi Valkeinen [off-list ref] wrote:
quoted
On 29/04/15 22:18, Luis R. Rodriguez wrote:
quoted
On Tue, Apr 21, 2015 at 1:16 PM, Luis R. Rodriguez
[off-list ref] wrote:
quoted
From: "Luis R. Rodriguez" <redacted>
This series addresses simple changes to framebuffer drivers to use
arch_phys_wc_add() and ioremap_wc() as well as fixing gbefb to add
missing mtrr_del() calls. These changes are pretty straight forward.
Luis R. Rodriguez (17):
video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: gbefb: add missing mtrr_del() calls
video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc()
video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc()
video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer
video: fbdev: geode gxfb: use ioremap_wc() for framebuffer
These 17 are all
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tomi, can you please take them via the fbdev tree?
From: Tomi Valkeinen <hidden> Date: 2015-05-20 08:50:38
On 14/05/15 17:26, Luis R. Rodriguez wrote:
Tomi,
Any chance you can consider this series again? I realize you say you are
not familiar with MTRR but given its prevalence use on framebuffer device
drivers and since you are a framebuffer subsystem maintainer I think its
perhaps fair to ask one of you become familiar with this stuff, or ask
questions if there are any. If its of any help this patch which adds
ioremap_uc() already got merged and the logic to phase MTRR is described
there too:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=e4b6be33c28923d8cde53023e0888b1c5d1a9027
That patch won't even be needed on this series, this series happens to be
straight forward: if you just ioremap_nocache() once and use mtrr_add()
then conver over to ioremap_wc() and use arch_phys_wc_add(). If it already
used ioremap_wc() just convert over from mtrr_add() to arch_phys_wc_add()
Not sure if you will get an Acked-by by x86 folks on this series as they
are busy, but I'm adding bp and hpa just in case.
These are now queued for 4.2. Sorry it took so long. I've been away and
my bandwidth for the fbdev maintainership has been rather limited lately.
Tomi
From: Luis R. Rodriguez <hidden> Date: 2015-05-20 18:58:33
On Wed, May 20, 2015 at 11:50:38AM +0300, Tomi Valkeinen wrote:
On 14/05/15 17:26, Luis R. Rodriguez wrote:
quoted
Tomi,
Any chance you can consider this series again? I realize you say you are
not familiar with MTRR but given its prevalence use on framebuffer device
drivers and since you are a framebuffer subsystem maintainer I think its
perhaps fair to ask one of you become familiar with this stuff, or ask
questions if there are any. If its of any help this patch which adds
ioremap_uc() already got merged and the logic to phase MTRR is described
there too:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?idäb6be33c28923d8cde53023e0888b1c5d1a9027
That patch won't even be needed on this series, this series happens to be
straight forward: if you just ioremap_nocache() once and use mtrr_add()
then conver over to ioremap_wc() and use arch_phys_wc_add(). If it already
used ioremap_wc() just convert over from mtrr_add() to arch_phys_wc_add()
Not sure if you will get an Acked-by by x86 folks on this series as they
are busy, but I'm adding bp and hpa just in case.
These are now queued for 4.2. Sorry it took so long. I've been away and
my bandwidth for the fbdev maintainership has been rather limited lately.