diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2018-07-30 13:52:34 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-07-30 13:52:34 +0300 |
commit | 0239520e0290e7d5f186f7fb7f7ce307c478a439 (patch) | |
tree | d19c62cc463847c3bf6f8e1d9ca03c488c3649d5 /drivers/gpu/drm/armada/armada_hw.h | |
parent | 1729f56010a960f182a36e09ce8d6504fa637d76 (diff) | |
download | linux-0239520e0290e7d5f186f7fb7f7ce307c478a439.tar.xz |
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.h | 15 |
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 |