]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/sun4i: Fix the high buffer address mask
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 19 Sep 2016 19:53:08 +0000 (21:53 +0200)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 22 Sep 2016 07:13:22 +0000 (10:13 +0300)
The highest 3bits of the 4 layers buffers are all part of the same
register. However, our mask computation was wrong, leading to all the
lowest register bits being removed when we use regmap_update_bits, which
will lead to the buffers being set to some random part of the RAM.

Fix our mask.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_backend.h

index e00718627748491eae0bd0de2b055c7f761089ca..83e63cc702b412e2c0035d4dcd9b7ba27c9395ad 100644 (file)
@@ -52,8 +52,8 @@
 #define SUN4I_BACKEND_LAYFB_L32ADD_REG(l)      (0x850 + (0x4 * (l)))
 
 #define SUN4I_BACKEND_LAYFB_H4ADD_REG          0x860
-#define SUN4I_BACKEND_LAYFB_H4ADD_MSK(l)               GENMASK(3 + ((l) * 8), 0)
-#define SUN4I_BACKEND_LAYFB_H4ADD(l, val)                      ((val) << ((l) * 8))
+#define SUN4I_BACKEND_LAYFB_H4ADD_MSK(l)               GENMASK(3 + ((l) * 8), (l) * 8)
+#define SUN4I_BACKEND_LAYFB_H4ADD(l, val)              ((val) << ((l) * 8))
 
 #define SUN4I_BACKEND_REGBUFFCTL_REG           0x870
 #define SUN4I_BACKEND_REGBUFFCTL_AUTOLOAD_DIS          BIT(1)