summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/arm
diff options
context:
space:
mode:
authorBrian Starkey <brian.starkey@arm.com>2016-10-11 15:26:07 +0100
committerLiviu Dudau <Liviu.Dudau@arm.com>2016-11-04 17:09:19 +0000
commit15807780684646949ba9e8f6f56cc3542b04c1ae (patch)
tree6bab2c4e495e862c220ca6f56035acb48ce6d3f5 /drivers/gpu/drm/arm
parentde9c4810abc6a2e38c93a31bddfa9c0a502f7212 (diff)
downloadop-kernel-dev-15807780684646949ba9e8f6f56cc3542b04c1ae.zip
op-kernel-dev-15807780684646949ba9e8f6f56cc3542b04c1ae.tar.gz
drm: mali-dp: Refactor plane initialisation
As we add more features, it makes sense to skip all the features not supported by the smart layer together, instead of checking each one individually. Achieve this by refactoring the plane init loop. Signed-off-by: Brian Starkey <brian.starkey@arm.com> [re-factor code after upstream changed rotation property to be per-plane] Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm')
-rw-r--r--drivers/gpu/drm/arm/malidp_planes.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index eaae819..11578de 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -235,6 +235,8 @@ int malidp_de_planes_init(struct drm_device *drm)
struct malidp_plane *plane = NULL;
enum drm_plane_type plane_type;
unsigned long crtcs = 1 << drm->mode_config.num_crtc;
+ unsigned long flags = DRM_ROTATE_0 | DRM_ROTATE_90 | DRM_ROTATE_180 |
+ DRM_ROTATE_270 | DRM_REFLECT_X | DRM_REFLECT_Y;
u32 *formats;
int ret, i, j, n;
@@ -267,23 +269,16 @@ int malidp_de_planes_init(struct drm_device *drm)
if (ret < 0)
goto cleanup;
- /* SMART layer can't be rotated */
- if (id != DE_SMART) {
- unsigned long flags = DRM_ROTATE_0 |
- DRM_ROTATE_90 |
- DRM_ROTATE_180 |
- DRM_ROTATE_270 |
- DRM_REFLECT_X |
- DRM_REFLECT_Y;
- drm_plane_create_rotation_property(&plane->base,
- DRM_ROTATE_0,
- flags);
- }
-
drm_plane_helper_add(&plane->base,
&malidp_de_plane_helper_funcs);
plane->hwdev = malidp->dev;
plane->layer = &map->layers[i];
+
+ /* Skip the features which the SMART layer doesn't have */
+ if (id == DE_SMART)
+ continue;
+
+ drm_plane_create_rotation_property(&plane->base, DRM_ROTATE_0, flags);
}
kfree(formats);
OpenPOWER on IntegriCloud