All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: robdclark@gmail.com
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	daniel@ffwll.ch, maarten.lankhorst@linux.intel.com,
	Archit Taneja <architt@codeaurora.org>
Subject: [PATCH 3/9] drm/msm/mdp5: Prepare CRTC/LM for empty stages
Date: Mon, 19 Dec 2016 17:38:52 +0530	[thread overview]
Message-ID: <1482149338-586-4-git-send-email-architt@codeaurora.org> (raw)
In-Reply-To: <1482149338-586-1-git-send-email-architt@codeaurora.org>

Use SSPP_NONE in mdp5_plane_pipe() if there is now hwpipe allocated for
the drm_plane. Returning '0' means we are returning VIG0 pipe.

Also, use the mdp5_pipe enum to pass around the stage array. Initialize
the stage to SSPP_NONE by default.

We do the above because 1) Cursor plane has to be staged at the topmost
blender of the LM, which can result in empty stages in between 2) In
the future, when we support multiple LMs per CRTC. We could have stages
which don't have any pipe assigned to them.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c  | 2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c   | 4 ++--
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.h   | 4 ++--
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
index 1ce8a01..7a47209 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
@@ -195,7 +195,7 @@ static void blend_setup(struct drm_crtc *crtc)
 	uint32_t lm = mdp5_crtc->lm;
 	uint32_t blend_op, fg_alpha, bg_alpha, ctl_blend_flags = 0;
 	unsigned long flags;
-	uint8_t stage[STAGE_MAX + 1];
+	enum mdp5_pipe stage[STAGE_MAX + 1] = { SSPP_NONE };
 	int i, plane_cnt = 0;
 #define blender(stage)	((stage) - STAGE0)
 
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
index d021edc..ab339ce 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
@@ -351,8 +351,8 @@ static u32 mdp_ctl_blend_ext_mask(enum mdp5_pipe pipe,
 	}
 }
 
-int mdp5_ctl_blend(struct mdp5_ctl *ctl, u8 *stage, u32 stage_cnt,
-	u32 ctl_blend_op_flags)
+int mdp5_ctl_blend(struct mdp5_ctl *ctl, enum mdp5_pipe *stage, u32 stage_cnt,
+		   u32 ctl_blend_op_flags)
 {
 	unsigned long flags;
 	u32 blend_cfg = 0, blend_ext_cfg = 0;
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.h b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.h
index 96148c6..fda00d3 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.h
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.h
@@ -56,8 +56,8 @@ int mdp5_ctl_set_pipeline(struct mdp5_ctl *ctl, struct mdp5_interface *intf,
  * (call mdp5_ctl_commit() with mdp_ctl_flush_mask_ctl() mask)
  */
 #define MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT	BIT(0)
-int mdp5_ctl_blend(struct mdp5_ctl *ctl, u8 *stage, u32 stage_cnt,
-	u32 ctl_blend_op_flags);
+int mdp5_ctl_blend(struct mdp5_ctl *ctl, enum mdp5_pipe *stage, u32 stage_cnt,
+		   u32 ctl_blend_op_flags);
 
 /**
  * mdp_ctl_flush_mask...() - Register FLUSH masks
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
index 75247ea..72a9f98 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
@@ -836,7 +836,7 @@ enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane)
 	struct mdp5_plane_state *pstate = to_mdp5_plane_state(plane->state);
 
 	if (WARN_ON(!pstate->hwpipe))
-		return 0;
+		return SSPP_NONE;
 
 	return pstate->hwpipe->pipe;
 }
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

  parent reply	other threads:[~2016-12-19 12:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 12:08 [PATCH 0/9] drm/msm/mdp5: Cursor plane stuff Archit Taneja
2016-12-19 12:08 ` [PATCH 1/9] drm/msm/mdp5: cfg: Add pipe_cursor block Archit Taneja
2016-12-19 12:08 ` [PATCH 2/9] drm/msm/mdp5: Update generated headers Archit Taneja
2016-12-19 12:08 ` Archit Taneja [this message]
2016-12-19 12:08 ` [PATCH 4/9] drm/msm/mdp5: Use plane helpers to configure src/dst rectangles Archit Taneja
2016-12-19 12:08 ` [PATCH 5/9] drm/msm/mdp5: Configure COLOR3_OUT propagation Archit Taneja
2016-12-19 12:08 ` [PATCH 6/9] drm/msm/mdp5: Misc cursor plane bits Archit Taneja
2016-12-19 12:08 ` [PATCH 7/9] drm/msm/mdp5: Refactor mdp5_plane_atomic_check Archit Taneja
2016-12-19 12:08 ` [RFC 8/9] HACK: drm/msm/mdp5: Add support for legacy cursor updates Archit Taneja
2016-12-19 12:50   ` Maarten Lankhorst
2016-12-20  6:23     ` Archit Taneja
2016-12-20 13:40       ` Maarten Lankhorst
2016-12-21  5:23         ` Archit Taneja
2016-12-19 16:00   ` Daniel Vetter
2016-12-19 16:51     ` Daniel Vetter
2016-12-19 12:08 ` [PATCH 9/9] drm/msm/mdp5: Add cursor planes Archit Taneja
2016-12-19 15:50 ` [PATCH 0/9] drm/msm/mdp5: Cursor plane stuff Daniel Vetter
2017-01-17  4:45 ` [PATCH v2 0/8] " Archit Taneja
2017-01-17  4:45   ` [PATCH v2 1/8] drm/msm/mdp5: cfg: Add pipe_cursor block Archit Taneja
2017-01-17  4:45   ` [PATCH v2 2/8] drm/msm/mdp5: Prepare CRTC/LM for empty stages Archit Taneja
2017-01-17  4:45   ` [PATCH v2 3/8] drm/msm/mdp5: Use plane helpers to configure src/dst rectangles Archit Taneja
2017-01-17  4:45   ` [PATCH v2 4/8] drm/msm/mdp5: Configure COLOR3_OUT propagation Archit Taneja
2017-01-17  4:45   ` [PATCH v2 5/8] drm/msm/mdp5: Misc cursor plane bits Archit Taneja
2017-01-17  4:45   ` [PATCH v2 6/8] drm/msm/mdp5: Add cursor planes Archit Taneja
2017-01-17  4:45   ` [PATCH v2 7/8] drm/msm/mdp5: Refactor mdp5_plane_atomic_check Archit Taneja
2017-01-17  4:45   ` [PATCH v2 8/8] HACK: drm/msm/mdp5: Add support for legacy cursor updates Archit Taneja

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=1482149338-586-4-git-send-email-architt@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=robdclark@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.