dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Brian Starkey <brian.starkey@arm.com>
To: dri-devel@lists.freedesktop.org
Cc: liviu.dudau@arm.com, linux-kernel@vger.kernel.org
Subject: [PATCH 6/8] drm: mali-dp: Refactor plane initialisation
Date: Tue, 11 Oct 2016 15:26:07 +0100	[thread overview]
Message-ID: <1476195969-23655-6-git-send-email-brian.starkey@arm.com> (raw)
In-Reply-To: <1476195969-23655-1-git-send-email-brian.starkey@arm.com>

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-10-11 14:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11 14:26 [PATCH 1/8] drm: mali-dp: Set the drm->irq_enabled flag to match driver's state Brian Starkey
2016-10-11 14:26 ` [PATCH 2/8] drm: mali-dp: Clear the config_valid flag before using it in wait_event Brian Starkey
2016-10-11 14:26 ` [PATCH 3/8] drm: mali-dp: Add pitch alignment check function Brian Starkey
2016-10-11 14:26 ` [PATCH 4/8] drm: mali-dp: Add pitch alignment check for planes Brian Starkey
2016-10-11 14:26 ` [PATCH 5/8] arm: mali-dp: Extract mode_config cleanup into malidp_fini Brian Starkey
2016-10-11 14:26 ` Brian Starkey [this message]
2016-10-11 14:26 ` [PATCH 7/8] drm: mali-dp: Enable alpha blending Brian Starkey
2016-10-11 14:26 ` [PATCH 8/8] drm: mali-dp: Store internal format and n_planes in plane state Brian Starkey
2016-10-11 15:03 ` [PATCH 1/8] drm: mali-dp: Set the drm->irq_enabled flag to match driver's state liviu.dudau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476195969-23655-6-git-send-email-brian.starkey@arm.com \
    --to=brian.starkey@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).