1. 17 Jun, 2015 8 commits
  2. 16 Jun, 2015 4 commits
    • Vladimir Murzin's avatar
      fbdev: propagate result of fb_videomode_from_videomode() · 9f5ddefd
      Vladimir Murzin authored
      fb_videomode_from_videomode() may fail, but of_get_fb_videomode()
      silently covers this fact. Instead, trow the error code to the
      caller.
      Signed-off-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      9f5ddefd
    • Luis R. Rodriguez's avatar
      video: fbdev: vesafb: use arch_phys_wc_add() · 127b0c94
      Luis R. Rodriguez authored
      This driver uses the same area for MTRR as for the ioremap_wc(), if
      anything it just uses a smaller size in case MTRR reservation fails.
      ioremap_wc() API is already used to take advantage of architecture
      write-combining when available.
      
      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.
      
      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: Toshi Kani <toshi.kani@hp.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: Rob Clark <robdclark@gmail.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Wolfram Sang <wsa@the-dreams.de>
      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>
      127b0c94
    • Luis R. Rodriguez's avatar
      video: fbdev: vesafb: add missing mtrr_del() for added MTRR · 6b41f27d
      Luis R. Rodriguez authored
      The MTRR added was never being deleted, in order to store the
      MTRR cookie we need to make use of the private info->par so we
      create a struct for this. This driver was already using the extra
      space typically used for info->par for the info->pseudo_palette
      which typically used stuffed on driver's own private structs
      (the respective info->par), so we just move the pseudo_palette
      into the private struct as well.
      
      Cc: Toshi Kani <toshi.kani@hp.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: Rob Clark <robdclark@gmail.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Wolfram Sang <wsa@the-dreams.de>
      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>
      6b41f27d
    • Luis R. Rodriguez's avatar
      video: fbdev: vesafb: only support MTRR_TYPE_WRCOMB · 87b81762
      Luis R. Rodriguez authored
      No other video driver uses MTRR types except for MTRR_TYPE_WRCOMB,
      the other MTRR types were implemented and supported here but with
      no real good reason. The ioremap() APIs are architecture agnostic and
      at least on x86 PAT is a new design that extends MTRRs and
      can replace it in a much cleaner way, where so long as the
      proper ioremap_wc() or variant API is used the right thing will
      be done behind the scenes. This is the only driver left using the
      other MTRR types -- and since there is no good reason for it now
      rip them out.
      
      Cc: Toshi Kani <toshi.kani@hp.com>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Wolfram Sang <wsa@the-dreams.de>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      87b81762
  3. 12 Jun, 2015 3 commits
  4. 05 Jun, 2015 1 commit
  5. 04 Jun, 2015 9 commits
  6. 03 Jun, 2015 15 commits
    • Misael Lopez Cruz's avatar
      ASoC: omap-hdmi-audio: Fix invalid combination of DM_INH and CA · 51603478
      Misael Lopez Cruz authored
      DM_INH = 1 (stereo downmix prohibited) and CA = 0x00 (Channel
      Allocation: FR, FL) is an invalid combination according to the
      HDMI Compliance Test 7.31 "Audio InfoFrame".
      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>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      51603478
    • Misael Lopez Cruz's avatar
      ASoC: omap-hdmi-audio: Force channel allocation only for OMAP4 · 88359b99
      Misael Lopez Cruz authored
      There is a constraint in the OMAP4 HDMI IP that requires to use
      the 8-channel code when transmitting more than two channels.
      
      The constraint doesn't apply for OMAP5 so don't force the channel
      allocation in the sound driver as it can be done specifically for
      OMAP4 later in the hdmi4 core.
      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>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      88359b99
    • Misael Lopez Cruz's avatar
      OMAPDSS: HDMI5: Fix AUDICONF3 bitfield offsets · 65c8b464
      Misael Lopez Cruz authored
      Downmix inhibit in HDMI_CORE_FC_AUDICONF3 register is in
      bit 4 while CEA861_AUDIO_INFOFRAME_DB5_DM_INH sets bit 7.
      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>
      65c8b464
    • 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
    • Tomi Valkeinen's avatar
      arm: dra7: add DESHDCP clock · 2d5a3c80
      Tomi Valkeinen authored
      Add a new Linux clock for DRA7 based SoCs to control DESHDCP clock.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: default avatarTero Kristo <t-kristo@ti.com>
      2d5a3c80
    • 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