1. 03 Jun, 2015 18 commits
    • Misael Lopez Cruz's avatar
      OMAPDSS: HDMI5: Set valid sample order · aae1428c
      Misael Lopez Cruz authored
      As per TRM, HDMI_WP_AUDIO_CFG[2] LEFT_BEFORE = 0 is reserved,
      so it must always be set to 1 (the first sample is the left).
      Signed-off-by: default avatarMisael Lopez Cruz <misael.lopez@ti.com>
      Signed-off-by: default avatarJyri Sarha <jsarha@ti.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      aae1428c
    • Misael Lopez Cruz's avatar
      OMAPDSS: HDMI4: Set correct CC for 8-channels layout · 7877039f
      Misael Lopez Cruz authored
      OMAP4 HDMI IP uses the 8-channel layout with 8-channel speaker
      allocation mask when transmitting more than two channels.  But
      the channel count field (CC) of the Audio InfoFrame's DB1 is
      not updated for 8-channels.
      
      As per HDMI Compliance Test 7.31 "Audio InfoFrame", CC = 7 is
      required for 8-channels CA masks (0x13 and 0x1F).
      Signed-off-by: default avatarMisael Lopez Cruz <misael.lopez@ti.com>
      Signed-off-by: default avatarJyri Sarha <jsarha@ti.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      7877039f
    • Uwe Kleine-König's avatar
      fbdev: omap2: improve usage of gpiod API · ca8c67da
      Uwe Kleine-König authored
      Since 39b2bbe3 (gpio: add flags argument to gpiod_get*() functions)
      which appeared in v3.17-rc1, the gpiod_get* functions take an additional
      parameter that allows to specify direction and initial value for output.
      
      Also make use of gpiod_get*_optional where applicable.
      
      Apart from simplification of the affected drivers this is another step
      towards making the flags argument to gpiod_get*() mandatory.
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      ca8c67da
    • Luis R. Rodriguez's avatar
      video: fbdev: geode gxfb: use ioremap_wc() for framebuffer · 9ccfc4aa
      Luis R. Rodriguez authored
      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
         de33c442 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 <jg1.han@samsung.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-geode@lists.infradead.org
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      9ccfc4aa
    • Luis R. Rodriguez's avatar
      video: fbdev: atmel_lcdfb: use ioremap_wc() for framebuffer · 1e43a203
      Luis R. Rodriguez authored
      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
         de33c442 titled "x86 PAT: fix performance drop for glx,
         use UC minus for ioremap(), ioremap_nocache() and
         pci_mmap_page_range()")
      
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      1e43a203
    • Luis R. Rodriguez's avatar
      video: fbdev: tdfxfb: use arch_phys_wc_add() and ioremap_wc() · cc9866eb
      Luis R. Rodriguez authored
      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
         de33c442 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 <robdclark@gmail.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      cc9866eb
    • Luis R. Rodriguez's avatar
      video: fbdev: rivafb: use arch_phys_wc_add() and ioremap_wc() · 04dc78b4
      Luis R. Rodriguez authored
      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
         de33c442 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 <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      04dc78b4
    • Luis R. Rodriguez's avatar
      video: fbdev: pm3fb: use arch_phys_wc_add() and ioremap_wc() · 26e25060
      Luis R. Rodriguez authored
      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
         de33c442 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 <jg1.han@samsung.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      26e25060
    • Luis R. Rodriguez's avatar
      video: fbdev: pm2fb: use arch_phys_wc_add() and ioremap_wc() · f8f05cdc
      Luis R. Rodriguez authored
      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
         de33c442 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 <robdclark@gmail.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      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 <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      f8f05cdc
    • Luis R. Rodriguez's avatar
      video: fbdev: i810: use arch_phys_wc_add() and ioremap_wc() · 775a8a56
      Luis R. Rodriguez authored
      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
         de33c442 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 <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      775a8a56
    • Luis R. Rodriguez's avatar
      video: fbdev: aty: use arch_phys_wc_add() and ioremap_wc() · f4447dde
      Luis R. Rodriguez authored
      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
         de33c442 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 <paulus@samba.org>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      f4447dde
    • Luis R. Rodriguez's avatar
      video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc() · 2cff6406
      Luis R. Rodriguez authored
      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
         de33c442 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 <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      2cff6406
    • Luis R. Rodriguez's avatar
      video: fbdev: savagefb: use arch_phys_wc_add() and ioremap_wc() · 4d811d6c
      Luis R. Rodriguez authored
      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
         de33c442 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 <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      4d811d6c
    • Luis R. Rodriguez's avatar
      video: fbdev: nvidia: use arch_phys_wc_add() and ioremap_wc() · 3b213c2f
      Luis R. Rodriguez authored
      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
         de33c442 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 <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      3b213c2f
    • Luis R. Rodriguez's avatar
      video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc() · f2081b81
      Luis R. Rodriguez authored
      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
         de33c442 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 <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      f2081b81
    • Luis R. Rodriguez's avatar
      video: fbdev: matrox: use arch_phys_wc_add() and ioremap_wc() · 888ca5d2
      Luis R. Rodriguez authored
      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
         de33c442 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 <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Mikulas Patocka <mpatocka@redhat.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      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: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      888ca5d2
    • Luis R. Rodriguez's avatar
      video: fbdev: intelfb: use arch_phys_wc_add() and ioremap_wc() · 78084dcf
      Luis R. Rodriguez authored
      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
         de33c442 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 <mbroemme@plusserver.de>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      78084dcf
    • Luis R. Rodriguez's avatar
      video: fbdev: gbefb: use arch_phys_wc_add() and devm_ioremap_wc() · 05314098
      Luis R. Rodriguez authored
      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
         de33c442 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 <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Masanari Iida <standby24x7@gmail.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      05314098
  2. 29 May, 2015 2 commits
    • Luis R. Rodriguez's avatar
      video: fbdev: gbefb: add missing mtrr_del() calls · 5944d733
      Luis R. Rodriguez authored
      This driver never removed the MTRRs. Fix that.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Masanari Iida <standby24x7@gmail.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      5944d733
    • Luis R. Rodriguez's avatar
      video: fbdev: radeonfb: use arch_phys_wc_add() and ioremap_wc() · 5e200b53
      Luis R. Rodriguez authored
      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
         de33c442 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 <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      5e200b53
  3. 27 May, 2015 16 commits
  4. 07 May, 2015 2 commits
  5. 04 May, 2015 2 commits