Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1498917

[PATCH 6/8] drm: mali-dp: Refactor plane initialisation

From Brian Starkey <brian.starkey@arm.com>
Newsgroups linux.kernel
Subject [PATCH 6/8] drm: mali-dp: Refactor plane initialisation
Date 2016-10-11 16:30 +0200
Message-ID <sr6e5-7Rm-31@gated-at.bofh.it> (permalink)
References <sr6e5-7Rm-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_planes.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index f95e02d..a17d24b 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -267,6 +267,15 @@ int malidp_de_planes_init(struct drm_device *drm)
 		if (ret < 0)
 			goto cleanup;
 
+		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;
+
 		if (!drm->mode_config.rotation_property) {
 			unsigned long flags = DRM_ROTATE_0 |
 					      DRM_ROTATE_90 |
@@ -277,16 +286,12 @@ int malidp_de_planes_init(struct drm_device *drm)
 			drm->mode_config.rotation_property =
 				drm_mode_create_rotation_property(drm, flags);
 		}
-		/* SMART layer can't be rotated */
-		if (drm->mode_config.rotation_property && (id != DE_SMART))
+
+		if (drm->mode_config.rotation_property)
 			drm_object_attach_property(&plane->base.base,
 						   drm->mode_config.rotation_property,
 						   DRM_ROTATE_0);
 
-		drm_plane_helper_add(&plane->base,
-				     &malidp_de_plane_helper_funcs);
-		plane->hwdev = malidp->dev;
-		plane->layer = &map->layers[i];
 	}
 
 	kfree(formats);
-- 
1.7.9.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/8] drm: mali-dp: Set the drm->irq_enabled flag to match driver's state. Brian Starkey <brian.starkey@arm.com> - 2016-10-11 16:30 +0200
  [PATCH 6/8] drm: mali-dp: Refactor plane initialisation Brian Starkey <brian.starkey@arm.com> - 2016-10-11 16:30 +0200
  [PATCH 3/8] drm: mali-dp: Add pitch alignment check function Brian Starkey <brian.starkey@arm.com> - 2016-10-11 16:30 +0200
  [PATCH 7/8] drm: mali-dp: Enable alpha blending Brian Starkey <brian.starkey@arm.com> - 2016-10-11 16:30 +0200
  Re: [PATCH 1/8] drm: mali-dp: Set the drm->irq_enabled flag to match  driver's state. liviu.dudau@arm.com - 2016-10-11 17:10 +0200

csiph-web