summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tilcdc/tilcdc_regs.h
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2016-08-26 14:10:14 +0200
committerJyri Sarha <jsarha@ti.com>2016-09-01 21:31:59 +0200
commit7eb9f069ff5dd39d44d7ecdf63eb99b429c7dad0 (patch)
tree7e19fda5f1a9830b3ce48117a3793832fd2565f8 /drivers/gpu/drm/tilcdc/tilcdc_regs.h
parentdrm/tilcdc: Remove drm_helper_disable_unused_functions() call (diff)
downloadlinux-7eb9f069ff5dd39d44d7ecdf63eb99b429c7dad0.tar.xz
linux-7eb9f069ff5dd39d44d7ecdf63eb99b429c7dad0.zip
drm/tilcdc: Write DMA base and ceiling address with single instruction
Write DMA base and ceiling address with a single instruction, if available. This should make it more unlikely that LCDC would fetch the DMA addresses in the middle of an update. Having bad combination of addresses in dma base and ceiling (e.g base > ceiling) can cause unpredictaple behavior in LCDC. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/tilcdc/tilcdc_regs.h')
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_regs.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_regs.h b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
index 1bf5e2553acc..f57c0d62c76a 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_regs.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
@@ -119,6 +119,20 @@ static inline void tilcdc_write(struct drm_device *dev, u32 reg, u32 data)
iowrite32(data, priv->mmio + reg);
}
+static inline void tilcdc_write64(struct drm_device *dev, u32 reg, u64 data)
+{
+ struct tilcdc_drm_private *priv = dev->dev_private;
+ volatile void __iomem *addr = priv->mmio + reg;
+
+#ifdef iowrite64
+ iowrite64(data, addr);
+#else
+ __iowmb();
+ /* This compiles to strd (=64-bit write) on ARM7 */
+ *(volatile u64 __force *)addr = __cpu_to_le64(data);
+#endif
+}
+
static inline u32 tilcdc_read(struct drm_device *dev, u32 reg)
{
struct tilcdc_drm_private *priv = dev->dev_private;