diff options
author | Brian Starkey <brian.starkey@arm.com> | 2016-10-11 15:26:04 +0100 |
---|---|---|
committer | Liviu Dudau <Liviu.Dudau@arm.com> | 2016-11-04 17:08:06 +0000 |
commit | a228062cb4e43e0f94bf48107338757d4d5857b9 (patch) | |
tree | cbd50ab990fbc0b821d5e79dc78920904ff20097 /drivers/gpu/drm/arm/malidp_hw.h | |
parent | a6a7b9a207d46c6a32ecd1ed3ddd877640f90df4 (diff) | |
download | linux-a228062cb4e43e0f94bf48107338757d4d5857b9.tar.bz2 |
drm: mali-dp: Add pitch alignment check function
Different hardware versions have different requirements when it comes to
pitch alignment. Add a function which can be used to check pitch
alignment for a device.
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
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 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/arm/malidp_hw.h b/drivers/gpu/drm/arm/malidp_hw.h index 141743e9f3a6..087e1202db3d 100644 --- a/drivers/gpu/drm/arm/malidp_hw.h +++ b/drivers/gpu/drm/arm/malidp_hw.h @@ -88,6 +88,9 @@ struct malidp_hw_regmap { /* list of supported input formats for each layer */ const struct malidp_input_format *input_formats; const u8 n_input_formats; + + /* pitch alignment requirement in bytes */ + const u8 bus_align_bytes; }; struct malidp_hw_device { @@ -229,6 +232,12 @@ 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) +{ + return !(pitch & (hwdev->map.bus_align_bytes - 1)); +} + /* * background color components are defined as 12bits values, * they will be shifted right when stored on hardware that |