summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/armada/armada_hw.h
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2018-07-30 11:52:34 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2018-07-30 11:52:34 +0100
commit0239520e0290e7d5f186f7fb7f7ce307c478a439 (patch)
treed19c62cc463847c3bf6f8e1d9ca03c488c3649d5 /drivers/gpu/drm/armada/armada_hw.h
parent1729f56010a960f182a36e09ce8d6504fa637d76 (diff)
downloadlinux-0239520e0290e7d5f186f7fb7f7ce307c478a439.tar.bz2
drm/armada: add rectangle helpers
Add helpers to convert rectangle width/height and x/y to register values. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/armada/armada_hw.h')
-rw-r--r--drivers/gpu/drm/armada/armada_hw.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/armada/armada_hw.h b/drivers/gpu/drm/armada/armada_hw.h
index 345dc4d0851e..277580b36758 100644
--- a/drivers/gpu/drm/armada/armada_hw.h
+++ b/drivers/gpu/drm/armada/armada_hw.h
@@ -316,4 +316,19 @@ enum {
PWRDN_IRQ_LEVEL = 1 << 0,
};
+static inline u32 armada_rect_hw_fp(struct drm_rect *r)
+{
+ return (drm_rect_height(r) & 0xffff0000) | drm_rect_width(r) >> 16;
+}
+
+static inline u32 armada_rect_hw(struct drm_rect *r)
+{
+ return drm_rect_height(r) << 16 | (drm_rect_width(r) & 0x0000ffff);
+}
+
+static inline u32 armada_rect_yx(struct drm_rect *r)
+{
+ return (r)->y1 << 16 | ((r)->x1 & 0x0000ffff);
+}
+
#endif