diff options
author | Liviu Dudau <Liviu.Dudau@arm.com> | 2017-12-05 16:51:03 +0000 |
---|---|---|
committer | Liviu Dudau <Liviu.Dudau@arm.com> | 2018-03-14 11:38:02 +0000 |
commit | fcad73b9b1fb9580fd43f1349fd8ab34d5d456e9 (patch) | |
tree | 9561b1000b6bf2922fefbd85846bf08f398fd685 /drivers/gpu/drm/arm/malidp_hw.h | |
parent | 963976cfe9c54d4d9e725e61c90c47a4af6b5ea2 (diff) | |
download | lwn-fcad73b9b1fb9580fd43f1349fd8ab34d5d456e9.tar.gz lwn-fcad73b9b1fb9580fd43f1349fd8ab34d5d456e9.zip |
drm/mali-dp: Rotated planes need a larger pitch size.
Rotated planes need a pitch size that is aligned to 8 bytes
for older DP500 and DP550 and at least 64 bytes for DP650. Replace
the malidp_hw_pitch_valid() function with one that calculates
the correct pitch alignment to take into account rotation.
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm/malidp_hw.h')
-rw-r--r-- | drivers/gpu/drm/arm/malidp_hw.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/arm/malidp_hw.h b/drivers/gpu/drm/arm/malidp_hw.h index b0690ebb3565..42d3e7b9ba98 100644 --- a/drivers/gpu/drm/arm/malidp_hw.h +++ b/drivers/gpu/drm/arm/malidp_hw.h @@ -285,10 +285,16 @@ void malidp_se_irq_fini(struct drm_device *drm); u8 malidp_hw_get_format_id(const struct malidp_hw_regmap *map, u8 layer_id, u32 format); -static inline bool malidp_hw_pitch_valid(struct malidp_hw_device *hwdev, - unsigned int pitch) +static inline u8 malidp_hw_get_pitch_align(struct malidp_hw_device *hwdev, bool rotated) { - return !(pitch & (hwdev->hw->map.bus_align_bytes - 1)); + /* + * only hardware that cannot do 8 bytes bus alignments have further + * constraints on rotated planes + */ + if (hwdev->hw->map.bus_align_bytes == 8) + return 8; + else + return hwdev->hw->map.bus_align_bytes << (rotated ? 2 : 0); } /* U16.16 */ |