Skip to contentSkip to conversation

Introduce plane virtualization in DPU driver

PATCH New Sravanthi Kollukuduru 5 participants 9 messages Jun 20, 2018 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Introduce plane virtualization in DPU driver

Currently, each drm plane controls a single HW pipe. For all use cases where plane width exceeds the maximum pipe width, the DPU driver will require more than one HW pipe.

This patchset enables virtualization of planes through the following changes:
(1) Expose all the planes with the superset of formats and without any static binding of HW pipe during the initialization.
(2) Introduce the state based plane resource management.
(3) Dynamically assign a maximum of two pipes per plane based on plane capabilities in atomic check.

This patchset is based on https://patchwork.kernel.org/patch/10471479/

Sravanthi Kollukuduru (5):
drm/msm/dpu: remove smart dma support
drm/msm/dpu: enable cursor plane for primary crtc drm/msm/dpu: remove static binding of hw pipe to plane drm/msm/dpu: introduce state based plane resource management drm/msm/dpu: dynamic assignment of hw pipe to plane

 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c       |  103 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h       |    3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  104 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |   69 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c     |   76 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h     |    4 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c    |  159 +---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h    |   56 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |   48 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c      | 1063 ++++++++++--------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h      |   58 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c         |  156 +++-
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h         |   20 +
 drivers/gpu/drm/msm/msm_drv.h                  |    2 +-
 14 files changed, 744 insertions(+), 1177 deletions(-)
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

A message that is not in the archive (sent off-list or not yet received): 1529499020-8499-1-git-send-email-skolluku-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org

#2 lore raw

PATCH 1/5 drm/msm/dpu: remove smart dma support

Removing the smart dma feature implementation as it is currently not enabled on dpu driver.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c       |  51 +----
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  25 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |  19 --
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c     |  76 ++-----
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h     |   4 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c    | 159 +++------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h    |  56 +-----
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |  26 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c      | 265 ++-----------------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h      |  38 +---
 drivers/gpu/drm/msm/msm_drv.h                  |   2 +-
 11 files changed, 84 insertions(+), 637 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +1 -50
index 6c78c11c3..f0aafec 100644
@@ -230,12 +230,9 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
 		stage_idx = zpos_cnt[pstate->stage]++;
 		stage_cfg->stage[pstate->stage][stage_idx] =
 					dpu_plane_pipe(plane);
-		stage_cfg->multirect_index[pstate->stage][stage_idx] =
-					pstate->multirect_index;
 
 		DPU_EVT32(DRMID(crtc), DRMID(plane), stage_idx,
 			dpu_plane_pipe(plane) - SSPP_VIG0, pstate->stage,
-			pstate->multirect_index, pstate->multirect_mode,
 			format->base.pixel_format, fb ? fb->modifier : 0);
 
 		/* blend config update */
@@ -1334,14 +1331,13 @@ struct plane_state {
 	struct dpu_plane_state *dpu_pstate;
 	const struct drm_plane_state *drm_pstate;
 	int stage;
-	u32 pipe_id;
 };
 
 static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 		struct drm_crtc_state *state)
 {
 	struct dpu_crtc *dpu_crtc;
-	struct plane_state pstates[DPU_STAGE_MAX * 4];
+	struct plane_state pstates[DPU_STAGE_MAX * 2];
 	struct dpu_crtc_state *cstate;
 
 	const struct drm_plane_state *pstate;
@@ -1351,10 +1347,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 	struct dpu_private_state *dpu_priv_state;
 
 	int cnt = 0, rc = 0, mixer_width, i, z_pos;
-
-	struct dpu_multirect_plane_states multirect_plane[DPU_STAGE_MAX * 2];
-	int multirect_count = 0;
-	const struct drm_plane_state *pipe_staged[SSPP_MAX];
 	int left_zpos_cnt = 0, right_zpos_cnt = 0;
 
 	if (!crtc) {
@@ -1378,8 +1370,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 	if (state->active_changed)
 		state->mode_changed = true;
 
-	memset(pipe_staged, 0, sizeof(pipe_staged));
-
 	mixer_width = dpu_crtc_get_mixer_width(dpu_crtc, cstate, mode);
 
 	_dpu_crtc_setup_lm_bounds(crtc, state);
@@ -1398,18 +1388,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 		pstates[cnt].dpu_pstate = to_dpu_plane_state(pstate);
 		pstates[cnt].drm_pstate = pstate;
 		pstates[cnt].stage = pstate->normalized_zpos;
-		pstates[cnt].pipe_id = dpu_plane_pipe(plane);
-
-		if (pipe_staged[pstates[cnt].pipe_id]) {
-			multirect_plane[multirect_count].r0 =
-				pipe_staged[pstates[cnt].pipe_id];
-			multirect_plane[multirect_count].r1 = pstate;
-			multirect_count++;
-
-			pipe_staged[pstates[cnt].pipe_id] = NULL;
-		} else {
-			pipe_staged[pstates[cnt].pipe_id] = pstate;
-		}
 
 		cnt++;
 
@@ -1426,20 +1404,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 		}
 	}
 
-	for (i = 1; i < SSPP_MAX; i++) {
-		if (pipe_staged[i]) {
-			dpu_plane_clear_multirect(pipe_staged[i]);
-
-			if (is_dpu_plane_virtual(pipe_staged[i]->plane)) {
-				DPU_ERROR(
-					"r1 only virt plane:%d not supported\n",
-					pipe_staged[i]->plane->base.id);
-				rc  = -EINVAL;
-				goto end;
-			}
-		}
-	}
-
 	z_pos = -1;
 	for (i = 0; i < cnt; i++) {
 		/* reset counts at every new blend stage */
@@ -1478,17 +1442,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 		DPU_DEBUG("%s: zpos %d", dpu_crtc->name, z_pos);
 	}
 
-	for (i = 0; i < multirect_count; i++) {
-		if (dpu_plane_validate_multirect_v2(&multirect_plane[i])) {
-			DPU_ERROR(
-			"multirect validation failed for planes (%d - %d)\n",
-					multirect_plane[i].r0->plane->base.id,
-					multirect_plane[i].r1->plane->base.id);
-			rc = -EINVAL;
-			goto end;
-		}
-	}
-
 	rc = dpu_core_perf_crtc_check(crtc, state);
 	if (rc) {
 		DPU_ERROR("crtc%d failed performance check %d\n",
@@ -1708,8 +1661,6 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data)
 		seq_printf(s, "\tdst x:%4d dst_y:%4d dst_w:%4d dst_h:%4d\n",
 			state->crtc_x, state->crtc_y, state->crtc_w,
 			state->crtc_h);
-		seq_printf(s, "\tmultirect: mode: %d index: %d\n",
-			pstate->multirect_mode, pstate->multirect_index);
 
 		seq_puts(s, "\n");
 	}
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +10 -15
index ab46bf6..f0c2881 100644
@@ -58,7 +58,6 @@
 	.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
 	.max_mixer_blendstages = 0xb,
 	.qseed_type = DPU_SSPP_SCALER_QSEED3,
-	.smart_dma_rev = DPU_SSPP_SMART_DMA_V2,
 	.ubwc_version = DPU_HW_UBWC_VER_20,
 	.has_src_split = true,
 	.has_dim_layer = true,
@@ -134,12 +133,11 @@
 	.maxvdeciexp = MAX_VERT_DECIMATION,
 };
 
-#define _VIG_SBLK(num, sdma_pri) \
+#define _VIG_SBLK(num) \
 	{ \
 	.common = &sdm845_sspp_common, \
 	.maxdwnscale = MAX_DOWNSCALE_RATIO, \
 	.maxupscale = MAX_UPSCALE_RATIO, \
-	.smart_dma_priority = sdma_pri, \
 	.src_blk = {.name = STRCAT("sspp_src_", num), \
 		.id = DPU_SSPP_SRC, .base = 0x00, .len = 0x150,}, \
 	.scaler_blk = {.name = STRCAT("sspp_scaler", num), \
@@ -149,30 +147,27 @@
 		.id = DPU_SSPP_CSC_10BIT, \
 		.base = 0x1a00, .len = 0x100,}, \
 	.format_list = plane_formats_yuv, \
-	.virt_format_list = plane_formats, \
 	}
 
-#define _DMA_SBLK(num, sdma_pri) \
+#define _DMA_SBLK(num) \
 	{ \
 	.common = &sdm845_sspp_common, \
 	.maxdwnscale = SSPP_UNITY_SCALE, \
 	.maxupscale = SSPP_UNITY_SCALE, \
-	.smart_dma_priority = sdma_pri, \
 	.src_blk = {.name = STRCAT("sspp_src_", num), \
 		.id = DPU_SSPP_SRC, .base = 0x00, .len = 0x150,}, \
 	.format_list = plane_formats, \
-	.virt_format_list = plane_formats, \
 	}
 
-static const struct dpu_sspp_sub_blks sdm845_vig_sblk_0 = _VIG_SBLK("0", 5);
-static const struct dpu_sspp_sub_blks sdm845_vig_sblk_1 = _VIG_SBLK("1", 6);
-static const struct dpu_sspp_sub_blks sdm845_vig_sblk_2 = _VIG_SBLK("2", 7);
-static const struct dpu_sspp_sub_blks sdm845_vig_sblk_3 = _VIG_SBLK("3", 8);
+static const struct dpu_sspp_sub_blks sdm845_vig_sblk_0 = _VIG_SBLK("0");
+static const struct dpu_sspp_sub_blks sdm845_vig_sblk_1 = _VIG_SBLK("1");
+static const struct dpu_sspp_sub_blks sdm845_vig_sblk_2 = _VIG_SBLK("2");
+static const struct dpu_sspp_sub_blks sdm845_vig_sblk_3 = _VIG_SBLK("3");
 
-static const struct dpu_sspp_sub_blks sdm845_dma_sblk_0 = _DMA_SBLK("8", 1);
-static const struct dpu_sspp_sub_blks sdm845_dma_sblk_1 = _DMA_SBLK("9", 2);
-static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 = _DMA_SBLK("10", 3);
-static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK("11", 4);
+static const struct dpu_sspp_sub_blks sdm845_dma_sblk_0 = _DMA_SBLK("8");
+static const struct dpu_sspp_sub_blks sdm845_dma_sblk_1 = _DMA_SBLK("9");
+static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 = _DMA_SBLK("10");
+static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK("11");
 
 #define SSPP_VIG_BLK(_name, _id, _base, _sblk, _xinid, _clkctrl) \
 	{ \
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +0 -19
index f0cb0d4..1b04448 100644
@@ -108,8 +108,6 @@ enum {
  * @DPU_SSPP_QOS,            SSPP support QoS control, danger/safe/creq
  * @DPU_SSPP_QOS_8LVL,       SSPP support 8-level QoS control
  * @DPU_SSPP_EXCL_RECT,      SSPP supports exclusion rect
- * @DPU_SSPP_SMART_DMA_V1,   SmartDMA 1.0 support
- * @DPU_SSPP_SMART_DMA_V2,   SmartDMA 2.0 support
  * @DPU_SSPP_TS_PREFILL      Supports prefill with traffic shaper
  * @DPU_SSPP_TS_PREFILL_REC1 Supports prefill with traffic shaper multirec
  * @DPU_SSPP_CDP             Supports client driven prefetch
@@ -126,8 +124,6 @@ enum {
 	DPU_SSPP_QOS,
 	DPU_SSPP_QOS_8LVL,
 	DPU_SSPP_EXCL_RECT,
-	DPU_SSPP_SMART_DMA_V1,
-	DPU_SSPP_SMART_DMA_V2,
 	DPU_SSPP_TS_PREFILL,
 	DPU_SSPP_TS_PREFILL_REC1,
 	DPU_SSPP_CDP,
@@ -298,7 +294,6 @@ struct dpu_qos_lut_tbl {
  * @max_mixer_blendstages max layer mixer blend stages or
  *                       supported z order
  * @qseed_type         qseed2 or qseed3 support.
- * @smart_dma_rev      Supported version of SmartDMA feature.
  * @ubwc_version       UBWC feature version (0x0 for not supported)
  * @has_src_split      source split feature status
  * @has_dim_layer      dim layer feature status
@@ -308,7 +303,6 @@ struct dpu_caps {
 	u32 max_mixer_width;
 	u32 max_mixer_blendstages;
 	u32 qseed_type;
-	u32 smart_dma_rev;
 	u32 ubwc_version;
 	bool has_src_split;
 	bool has_dim_layer;
@@ -338,7 +332,6 @@ struct dpu_sspp_blks_common {
  * @danger_vblank: danger priority during vertical blanking
  * @maxdwnscale: max downscale ratio supported(without DECIMATION)
  * @maxupscale:  maxupscale ratio supported
- * @smart_dma_priority: hw priority of rect1 of multirect pipe
  * @max_per_pipe_bw: maximum allowable bandwidth of this pipe in kBps
  * @src_blk:
  * @scaler_blk:
@@ -348,7 +341,6 @@ struct dpu_sspp_blks_common {
  * @pcc_blk:
  * @igc_blk:
  * @format_list: Pointer to list of supported formats
- * @virt_format_list: Pointer to list of supported formats for virtual planes
  */
 struct dpu_sspp_sub_blks {
 	const struct dpu_sspp_blks_common *common;
@@ -356,7 +348,6 @@ struct dpu_sspp_sub_blks {
 	u32 danger_vblank;
 	u32 maxdwnscale;
 	u32 maxupscale;
-	u32 smart_dma_priority;
 	u32 max_per_pipe_bw;
 	struct dpu_src_blk src_blk;
 	struct dpu_scaler_blk scaler_blk;
@@ -367,7 +358,6 @@ struct dpu_sspp_sub_blks {
 	struct dpu_pp_blk igc_blk;
 
 	const struct dpu_format_extended *format_list;
-	const struct dpu_format_extended *virt_format_list;
 };
 
 /**
@@ -792,13 +782,4 @@ struct dpu_mdss_hw_cfg_handler {
  */
 void dpu_hw_catalog_deinit(struct dpu_mdss_cfg *dpu_cfg);
 
-/**
- * dpu_hw_sspp_multirect_enabled - check multirect enabled for the sspp
- * @cfg:          pointer to sspp cfg
- */
-static inline bool dpu_hw_sspp_multirect_enabled(const struct dpu_sspp_cfg *cfg)
-{
-	return test_bit(DPU_SSPP_SMART_DMA_V1, &cfg->features) ||
-			 test_bit(DPU_SSPP_SMART_DMA_V2, &cfg->features);
-}
 #endif /* _DPU_HW_CATALOG_H */
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +19 -57

126 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h +0 -4
index c66a71f..729fc10 100644
@@ -16,7 +16,6 @@
 #include "dpu_hw_mdss.h"
 #include "dpu_hw_util.h"
 #include "dpu_hw_catalog.h"
-#include "dpu_hw_sspp.h"
 #include "dpu_hw_blk.h"
 
 /**
@@ -33,12 +32,9 @@ enum dpu_ctl_mode_sel {
 /**
  * struct dpu_hw_stage_cfg - blending stage cfg
  * @stage : SSPP_ID at each stage
- * @multirect_index: index of the rectangle of SSPP.
  */
 struct dpu_hw_stage_cfg {
 	enum dpu_sspp stage[DPU_STAGE_MAX][PIPES_PER_STAGE];
-	enum dpu_sspp_multirect_index multirect_index
-					[DPU_STAGE_MAX][PIPES_PER_STAGE];
 };
 
 /**
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +24 -135

262 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h +5 -51

109 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +1 -25
index 8bd1224..3b17a02 100644
@@ -596,10 +596,6 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 	int primary_planes_idx = 0, i, ret;
 	int max_crtc_count;
 
-	u32 sspp_id[MAX_PLANES];
-	u32 master_plane_id[MAX_PLANES];
-	u32 num_virt_planes = 0;
-
 	if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev) {
 		DPU_ERROR("invalid dpu_kms\n");
 		return -EINVAL;
@@ -626,7 +622,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 			primary = false;
 
 		plane = dpu_plane_init(dev, catalog->sspp[i].id, primary,
-				(1UL << max_crtc_count) - 1, 0);
+				(1UL << max_crtc_count) - 1);
 		if (IS_ERR(plane)) {
 			DPU_ERROR("dpu_plane_init failed\n");
 			ret = PTR_ERR(plane);
@@ -637,26 +633,6 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 		if (primary)
 			primary_planes[primary_planes_idx++] = plane;
 
-		if (dpu_hw_sspp_multirect_enabled(&catalog->sspp[i]) &&
-			dpu_is_custom_client()) {
-			int priority =
-				catalog->sspp[i].sblk->smart_dma_priority;
-			sspp_id[priority - 1] = catalog->sspp[i].id;
-			master_plane_id[priority - 1] = plane->base.id;
-			num_virt_planes++;
-		}
-	}
-
-	/* Initialize smart DMA virtual planes */
-	for (i = 0; i < num_virt_planes; i++) {
-		plane = dpu_plane_init(dev, sspp_id[i], false,
-			(1UL << max_crtc_count) - 1, master_plane_id[i]);
-		if (IS_ERR(plane)) {
-			DPU_ERROR("dpu_plane for virtual SSPP init failed\n");
-			ret = PTR_ERR(plane);
-			goto fail;
-		}
-		priv->planes[priv->num_planes++] = plane;
 	}
 
 	max_crtc_count = min(max_crtc_count, primary_planes_idx);
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +22 -243

405 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h +1 -37
index f6fe6dd..3795a336 100644
@@ -46,8 +46,6 @@ struct dpu_plane_state {
 	struct msm_gem_address_space *aspace;
 	void *input_fence;
 	enum dpu_stage stage;
-	uint32_t multirect_index;
-	uint32_t multirect_mode;
 	bool pending;
 
 	/* scaler configuration */
@@ -57,16 +55,6 @@ struct dpu_plane_state {
 	struct dpu_hw_pipe_cdp_cfg cdp_cfg;
 };
 
-/**
- * struct dpu_multirect_plane_states: Defines multirect pair of drm plane states
- * @r0: drm plane configured on rect 0
- * @r1: drm plane configured on rect 1
- */
-struct dpu_multirect_plane_states {
-	const struct drm_plane_state *r0;
-	const struct drm_plane_state *r1;
-};
-
 #define to_dpu_plane_state(x) \
 	container_of(x, struct dpu_plane_state, base)
 
@@ -78,14 +66,6 @@ struct dpu_multirect_plane_states {
 enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane);
 
 /**
- * is_dpu_plane_virtual - check for virtual plane
- * @plane: Pointer to DRM plane object
- * returns: true - if the plane is virtual
- *          false - if the plane is primary
- */
-bool is_dpu_plane_virtual(struct drm_plane *plane);
-
-/**
  * dpu_plane_get_ctl_flush - get control flush mask
  * @plane:   Pointer to DRM plane object
  * @ctl: Pointer to control hardware
@@ -124,27 +104,11 @@ void dpu_plane_get_ctl_flush(struct drm_plane *plane, struct dpu_hw_ctl *ctl,
  * @pipe:  dpu hardware pipe identifier
  * @primary_plane: true if this pipe is primary plane for crtc
  * @possible_crtcs: bitmask of crtc that can be attached to the given pipe
- * @master_plane_id: primary plane id of a multirect pipe. 0 value passed for
- *                   a regular plane initialization. A non-zero primary plane
- *                   id will be passed for a virtual pipe initialization.
  *
  */
 struct drm_plane *dpu_plane_init(struct drm_device *dev,
 		uint32_t pipe, bool primary_plane,
-		unsigned long possible_crtcs, u32 master_plane_id);
-
-/**
- * dpu_plane_validate_multirecti_v2 - validate the multirect planes
- *				      against hw limitations
- * @plane: drm plate states of the multirect pair
- */
-int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane);
-
-/**
- * dpu_plane_clear_multirect - clear multirect bits for the given pipe
- * @drm_state: Pointer to DRM plane state
- */
-void dpu_plane_clear_multirect(const struct drm_plane_state *drm_state);
+		unsigned long possible_crtcs);
 
 /**
  * dpu_plane_wait_input_fence - wait for input fence object
drivers/gpu/drm/msm/msm_drv.h +1 -1
index 1affc7f..3958994 100644
@@ -62,7 +62,7 @@
 
 #define NUM_DOMAINS    4    /* one for KMS, then one per gpu core (?) */
 #define MAX_CRTCS      8
-#define MAX_PLANES     20
+#define MAX_PLANES     12
 #define MAX_ENCODERS   8
 #define MAX_BRIDGES    8
 #define MAX_CONNECTORS 8
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
#3 lore raw

PATCH 3/5 drm/msm/dpu: remove static binding of hw pipe to plane

In reply to a message not in the archive

Expose all planes with superset of formats and with no hw pipe static binding. Accordingly, remove checks from atomic_check reflecting the decoupling.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  26 +---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |  50 +++-----
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |  17 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c      | 158 ++++---------------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h      |   5 +-
 5 files changed, 56 insertions(+), 200 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +3 -23
index c0b8116..c2a7c64 100644
@@ -44,13 +44,6 @@
 #define DEFAULT_DPU_LINE_WIDTH		2048
 #define DEFAULT_DPU_OUTPUT_LINE_WIDTH	2560
 
-#define MAX_HORZ_DECIMATION	4
-#define MAX_VERT_DECIMATION	4
-
-#define MAX_UPSCALE_RATIO	20
-#define MAX_DOWNSCALE_RATIO	4
-#define SSPP_UNITY_SCALE	1
-
 #define STRCAT(X, Y) (X Y)
 
 /*************************************************************
@@ -58,9 +51,12 @@
  *************************************************************/
 /* DPU top level caps */
 static const struct dpu_caps sdm845_dpu_caps = {
+	.max_sspp_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
+	.max_sspp_pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
 	.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
 	.max_mixer_blendstages = 0xb,
 	.qseed_type = DPU_SSPP_SCALER_QSEED3,
+	.csc_type = DPU_SSPP_CSC_10BIT,
 	.ubwc_version = DPU_HW_UBWC_VER_20,
 	.has_src_split = true,
 	.has_dim_layer = true,
@@ -128,19 +124,8 @@
  * SSPP sub blocks config
  *************************************************************/
 
-/* SSPP common configuration */
-static const struct dpu_sspp_blks_common sdm845_sspp_common = {
-	.maxlinewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
-	.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
-	.maxhdeciexp = MAX_HORZ_DECIMATION,
-	.maxvdeciexp = MAX_VERT_DECIMATION,
-};
-
 #define _VIG_SBLK(num) \
 	{ \
-	.common = &sdm845_sspp_common, \
-	.maxdwnscale = MAX_DOWNSCALE_RATIO, \
-	.maxupscale = MAX_UPSCALE_RATIO, \
 	.src_blk = {.name = STRCAT("sspp_src_", num), \
 		.id = DPU_SSPP_SRC, .base = 0x00, .len = 0x150,}, \
 	.scaler_blk = {.name = STRCAT("sspp_scaler", num), \
@@ -149,17 +134,12 @@
 	.csc_blk = {.name = STRCAT("sspp_csc", num), \
 		.id = DPU_SSPP_CSC_10BIT, \
 		.base = 0x1a00, .len = 0x100,}, \
-	.format_list = plane_formats_yuv, \
 	}
 
 #define _DMA_SBLK(num) \
 	{ \
-	.common = &sdm845_sspp_common, \
-	.maxdwnscale = SSPP_UNITY_SCALE, \
-	.maxupscale = SSPP_UNITY_SCALE, \
 	.src_blk = {.name = STRCAT("sspp_src_", num), \
 		.id = DPU_SSPP_SRC, .base = 0x00, .len = 0x150,}, \
-	.format_list = plane_formats, \
 	}
 
 static const struct dpu_sspp_sub_blks sdm845_vig_sblk_0 = _VIG_SBLK("0");
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +18 -32

93 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +10 -7
index 8e2e582..bef4e71 100644
@@ -616,13 +616,16 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 
 	/* Create the planes */
 	for (i = 0; i < catalog->sspp_count; i++) {
-		bool primary = true;
+		enum drm_plane_type type;
 
-		if (catalog->sspp[i].features & BIT(DPU_SSPP_CURSOR)
-			|| primary_planes_idx >= max_crtc_count)
-			primary = false;
+		if (catalog->sspp[i].features & BIT(DPU_SSPP_CURSOR))
+			type = DRM_PLANE_TYPE_CURSOR;
+		else if (primary_planes_idx < max_crtc_count)
+			type = DRM_PLANE_TYPE_PRIMARY;
+		else
+			type = DRM_PLANE_TYPE_OVERLAY;
 
-		plane = dpu_plane_init(dev, catalog->sspp[i].id, primary,
+		plane = dpu_plane_init(dev, catalog->sspp[i].id, type,
 				(1UL << max_crtc_count) - 1);
 		if (IS_ERR(plane)) {
 			DPU_ERROR("dpu_plane_init failed\n");
@@ -631,9 +634,9 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 		}
 		priv->planes[priv->num_planes++] = plane;
 
-		if (primary)
+		if (type == DRM_PLANE_TYPE_PRIMARY)
 			primary_planes[primary_planes_idx++] = plane;
-		if (catalog->sspp[i].features & BIT(DPU_SSPP_CURSOR))
+		if (type == DRM_PLANE_TYPE_CURSOR)
 			cursor_planes[cursor_planes_idx++] = plane;
 
 	}
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +23 -135

269 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h +2 -3
index 3795a336..e0688895 100644
@@ -102,12 +102,11 @@ void dpu_plane_get_ctl_flush(struct drm_plane *plane, struct dpu_hw_ctl *ctl,
  * dpu_plane_init - create new dpu plane for the given pipe
  * @dev:   Pointer to DRM device
  * @pipe:  dpu hardware pipe identifier
- * @primary_plane: true if this pipe is primary plane for crtc
+ * @type:  plane type - PRIMARY/CURSOR/OVERLAY
  * @possible_crtcs: bitmask of crtc that can be attached to the given pipe
- *
  */
 struct drm_plane *dpu_plane_init(struct drm_device *dev,
-		uint32_t pipe, bool primary_plane,
+		uint32_t pipe, enum drm_plane_type type,
 		unsigned long possible_crtcs);
 
 /**
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
#4 lore raw

PATCH 4/5 drm/msm/dpu: introduce state based plane resource management

In reply to a message not in the archive

A plane can be attached to a maximum of two hw pipes in case of wide resolution greater than pipe's max width limit. This mapping of hw pipe(s) to plane and number of pipes will be maintained in the plane state.
Resource manager (RM) will handle the SSPP blocks reservation for a given plane.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h |  11 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c    | 156 +++++++++++++++++++++++++++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h    |  20 ++++
 3 files changed, 172 insertions(+), 15 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h +11 -0
index e0688895..4eb929b 100644
@@ -25,6 +25,8 @@
 #include "dpu_hw_mdss.h"
 #include "dpu_hw_sspp.h"
 
+#define PLANE_DUAL_PIPES 2
+
 /**
  * struct dpu_plane_state: Define dpu extension of drm plane state object
  * @base:	base drm plane state object
@@ -36,6 +38,8 @@
  * @multirect_index: index of the rectangle of SSPP
  * @multirect_mode: parallel or time multiplex multirect mode
  * @pending:	whether the current update is still pending
+ * @num_pipes: number of pipes attached to plane
+ * @pipe_hw: array of pointers to hardware pipes reserved for plane
  * @scaler3_cfg: configuration data for scaler3
  * @pixel_ext: configuration data for pixel extensions
  * @scaler_check_state: indicates status of user provided pixel extension data
@@ -48,6 +52,10 @@ struct dpu_plane_state {
 	enum dpu_stage stage;
 	bool pending;
 
+	/* HW pipe config */
+	u32 num_pipes;
+	struct dpu_hw_pipe *pipe_hw[PLANE_DUAL_PIPES];
+
 	/* scaler configuration */
 	struct dpu_hw_scaler3_cfg scaler3_cfg;
 	struct dpu_hw_pixel_ext pixel_ext;
@@ -58,6 +66,9 @@ struct dpu_plane_state {
 #define to_dpu_plane_state(x) \
 	container_of(x, struct dpu_plane_state, base)
 
+/* get plane id from dpu plane state */
+#define get_plane_id(x) ((x->base.plane)->base.id)
+
 /**
  * dpu_plane_pipe - return sspp identifier for the given plane
  * @plane:   Pointer to DRM plane object
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +141 -15

247 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h +20 -0
index fa2cd70..b43e19a 100644
@@ -20,6 +20,7 @@
 #include "dpu_hw_top.h"
 #include "dpu_crtc.h"
 #include "dpu_encoder.h"
+#include "dpu_plane.h"
 
 /**
  * struct dpu_rm - DPU dynamic hardware resource manager
@@ -86,6 +87,25 @@ int dpu_rm_init(struct dpu_rm *rm,
 int dpu_rm_destroy(struct dpu_rm *rm);
 
 /**
+ * dpu_rm_reserve_plane_res - Reserve HW blocks for PLANE
+ * @rm: DPU Resource Manager handle
+ * @state: DPU PLANE state to cache HW block handles
+ * @num_pipes: Number of pipes to be reserved for the plane
+ * @caps: Reserve hw blocks with matching capabilities
+ * @Return: 0 on Success otherwise -ERROR
+ */
+int dpu_rm_reserve_plane_res(struct dpu_rm *rm, struct dpu_plane_state *state,
+				u32 num_pipes, u32 caps);
+
+/**
+ * dpu_rm_release_plane_res - Release HW blocks of PLANE
+ * @rm: DPU Resource Manager handle
+ * @state: DPU PLANE state to cache HW block handles
+ * @plane_id: Release reservation for given plane id
+ */
+int dpu_rm_release_plane_res(struct dpu_rm *rm, struct dpu_plane_state *state);
+
+/**
  * dpu_rm_reserve_crtc_res - Reserve HW blocks for CRTC
  * @rm: DPU Resource Manager handle
  * @state: DPU CRTC state to cache HW block handles
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
#5 lore raw

PATCH 5/5 drm/msm/dpu: dynamic assignment of hw pipe to plane

In reply to a message not in the archive

Currently, there exists a static binding of hw pipe to plane. This restricts wide plane support where plane width exceeds the pipe's maximum width.
To enable such use cases, the hw pipes are dynamically (re)allocated to a plane during atomic check based on the plane capabilities.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  |  45 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 670 +++++++++++++++++-------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h |   4 +-
 3 files changed, 414 insertions(+), 305 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +26 -19
index 56f6576..afb8c79 100644
@@ -175,7 +175,8 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
 	struct dpu_rect plane_crtc_roi;
 
 	u32 flush_mask;
-	uint32_t stage_idx, lm_idx;
+	uint32_t stage_idx = 0, lm_idx;
+	int i;
 	int zpos_cnt[DPU_STAGE_MAX + 1] = { 0 };
 	bool bg_alpha_enable = false;
 
@@ -204,11 +205,11 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
 
 		dpu_plane_get_ctl_flush(plane, ctl, &flush_mask);
 
-		DPU_DEBUG("crtc %d stage:%d - plane %d sspp %d fb %d\n",
-				crtc->base.id,
-				pstate->stage,
-				plane->base.id,
-				dpu_plane_pipe(plane) - SSPP_VIG0,
+		DPU_DEBUG("crtc %d stage%d: plane%d ssppmode%d[%d %d] fb%d\n",
+				crtc->base.id, pstate->stage,
+				plane->base.id, pstate->num_pipes,
+				dpu_plane_pipe(pstate->pipe_hw[0]) - SSPP_VIG0,
+				dpu_plane_pipe(pstate->pipe_hw[1]) - SSPP_VIG0,
 				state->fb ? state->fb->base.id : -1);
 
 		format = to_dpu_format(msm_framebuffer_format(pstate->base.fb));
@@ -221,19 +222,25 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
 			bg_alpha_enable = true;
 
 		DPU_EVT32(DRMID(crtc), DRMID(plane),
-				state->fb ? state->fb->base.id : -1,
-				state->src_x >> 16, state->src_y >> 16,
-				state->src_w >> 16, state->src_h >> 16,
-				state->crtc_x, state->crtc_y,
-				state->crtc_w, state->crtc_h);
-
-		stage_idx = zpos_cnt[pstate->stage]++;
-		stage_cfg->stage[pstate->stage][stage_idx] =
-					dpu_plane_pipe(plane);
-
-		DPU_EVT32(DRMID(crtc), DRMID(plane), stage_idx,
-			dpu_plane_pipe(plane) - SSPP_VIG0, pstate->stage,
-			format->base.pixel_format, fb ? fb->modifier : 0);
+			state->fb ? state->fb->base.id : -1,
+			state->src_x >> 16, state->src_y >> 16,
+			state->src_w >> 16, state->src_h >> 16,
+			state->crtc_x, state->crtc_y,
+			state->crtc_w, state->crtc_h);
+
+		for (i = 0; i < pstate->num_pipes; i++) {
+			stage_idx = zpos_cnt[pstate->stage]++;
+			if (stage_idx >= PIPES_PER_STAGE)
+				break;
+
+			stage_cfg->stage[pstate->stage][stage_idx] =
+				dpu_plane_pipe(pstate->pipe_hw[i]);
+
+			DPU_EVT32(DRMID(crtc), DRMID(plane), stage_idx,
+				dpu_plane_pipe(pstate->pipe_hw[i]) - SSPP_VIG0,
+				pstate->stage, format->base.pixel_format,
+				fb ? fb->modifier : 0);
+		}
 
 		/* blend config update */
 		for (lm_idx = 0; lm_idx < cstate->num_mixers; lm_idx++) {
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +386 -284

1,108 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h +2 -2
index 4eb929b..3ebc4c1 100644
@@ -71,10 +71,10 @@ struct dpu_plane_state {
 
 /**
  * dpu_plane_pipe - return sspp identifier for the given plane
- * @plane:   Pointer to DRM plane object
+ * @pipe_hw:   Pointer to DPU pipe hw
  * Returns: sspp identifier of the given plane
  */
-enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane);
+enum dpu_sspp dpu_plane_pipe(struct dpu_hw_pipe *pipe_hw);
 
 /**
  * dpu_plane_get_ctl_flush - get control flush mask
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
#6 lore raw

PATCH 2/5 drm/msm/dpu: enable cursor plane for primary crtc

In reply to Sravanthi Kollukuduru

Reserve one DMA pipe as cursor plane and also, update crtc support of cursor in crtc_init.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c       |  7 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h       |  3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 53 +++++++++++---------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |  7 +++-
 4 files changed, 34 insertions(+), 36 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +4 -3
index f0aafec..56f6576 100644
@@ -2027,7 +2027,8 @@ static int _dpu_crtc_init_events(struct dpu_crtc *dpu_crtc)
 }
 
 /* initialize crtc */
-struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane)
+struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
+						struct drm_plane *cursor_plane)
 {
 	struct drm_crtc *crtc = NULL;
 	struct dpu_crtc *dpu_crtc = NULL;
@@ -2061,8 +2062,8 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane)
 				dpu_crtc_frame_event_work);
 	}
 
-	drm_crtc_init_with_planes(dev, crtc, plane, NULL, &dpu_crtc_funcs,
-				NULL);
+	drm_crtc_init_with_planes(dev, crtc, plane,
+				cursor_plane, &dpu_crtc_funcs, NULL);
 
 	drm_crtc_helper_add(crtc, &dpu_crtc_helper_funcs);
 	plane->crtc = crtc;
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h +2 -1
index 50c3d4b..b44750d 100644
@@ -366,7 +366,8 @@ void dpu_crtc_complete_commit(struct drm_crtc *crtc,
  * @plane: base plane
  * @Return: new crtc object or error
  */
-struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane);
+struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
+		struct drm_plane *cursor_plane);
 
 /**
  * dpu_crtc_cancel_pending_flip - complete flip for clients on lastclose
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +23 -30

74 lines not on this page · raw message

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +5 -2
index 3b17a02..8e2e582 100644
@@ -588,12 +588,13 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 {
 	struct drm_device *dev;
 	struct drm_plane *primary_planes[MAX_PLANES], *plane;
+	struct drm_plane *cursor_planes[MAX_PLANES] = { NULL };
 	struct drm_crtc *crtc;
 
 	struct msm_drm_private *priv;
 	struct dpu_mdss_cfg *catalog;
 
-	int primary_planes_idx = 0, i, ret;
+	int primary_planes_idx = 0, cursor_planes_idx = 0, i, ret;
 	int max_crtc_count;
 
 	if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev) {
@@ -632,6 +633,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 
 		if (primary)
 			primary_planes[primary_planes_idx++] = plane;
+		if (catalog->sspp[i].features & BIT(DPU_SSPP_CURSOR))
+			cursor_planes[cursor_planes_idx++] = plane;
 
 	}
 
@@ -639,7 +642,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 
 	/* Create one CRTC per encoder */
 	for (i = 0; i < max_crtc_count; i++) {
-		crtc = dpu_crtc_init(dev, primary_planes[i]);
+		crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i]);
 		if (IS_ERR(crtc)) {
 			ret = PTR_ERR(crtc);
 			goto fail;
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): 1529499020-8499-3-git-send-email-skolluku-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org

#8 lore raw

Re: [DPU PATCH 2/5] drm/msm/dpu: enable cursor plane for primary crtc

Quoted 2 lines · Sravanthi Kollukuduru

Reserve one DMA pipe as cursor plane and also, update crtc support of cursor in crtc_init.

hmm, mdp5 in 820 had real cursor planes in hw, did these go away? If so I guess DMA plane is best candidate for cursor..

BR,
-R

Quoted 166 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c       |  7 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h       |  3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 53 +++++++++++---------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |  7 +++-
 4 files changed, 34 insertions(+), 36 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +4 -3
index f0aafec..56f6576 100644
@@ -2027,7 +2027,8 @@ static int _dpu_crtc_init_events(struct dpu_crtc *dpu_crtc)
 }
 
 /* initialize crtc */
-struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane)
+struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
+                                               struct drm_plane *cursor_plane)
 {
        struct drm_crtc *crtc = NULL;
        struct dpu_crtc *dpu_crtc = NULL;
@@ -2061,8 +2062,8 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane)
                                dpu_crtc_frame_event_work);
        }
 
-       drm_crtc_init_with_planes(dev, crtc, plane, NULL, &dpu_crtc_funcs,
-                               NULL);
+       drm_crtc_init_with_planes(dev, crtc, plane,
+                               cursor_plane, &dpu_crtc_funcs, NULL);
 
        drm_crtc_helper_add(crtc, &dpu_crtc_helper_funcs);
        plane->crtc = crtc;
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h +2 -1
index 50c3d4b..b44750d 100644
@@ -366,7 +366,8 @@ void dpu_crtc_complete_commit(struct drm_crtc *crtc,
  * @plane: base plane
  * @Return: new crtc object or error
  */
-struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane);
+struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
+               struct drm_plane *cursor_plane);
 
 /**
  * dpu_crtc_cancel_pending_flip - complete flip for clients on lastclose
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +23 -30
index f0c2881..c0b8116 100644
@@ -29,6 +29,9 @@
        BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
        BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT))
 
+#define DMA_CURSOR_SDM845_MASK \
+       (DMA_SDM845_MASK | BIT(DPU_SSPP_CURSOR))
+
 #define MIXER_SDM845_MASK \
        (BIT(DPU_MIXER_SOURCESPLIT) | BIT(DPU_DIM_LAYER))
 
@@ -169,45 +172,35 @@
 static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 = _DMA_SBLK("10");
 static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK("11");
 
-#define SSPP_VIG_BLK(_name, _id, _base, _sblk, _xinid, _clkctrl) \
-       { \
-       .name = _name, .id = _id, \
-       .base = _base, .len = 0x1c8, \
-       .features = VIG_SDM845_MASK, \
-       .sblk = &_sblk, \
-       .xin_id = _xinid, \
-       .type = SSPP_TYPE_VIG, \
-       .clk_ctrl = _clkctrl \
-       }
-
-#define SSPP_DMA_BLK(_name, _id, _base, _sblk, _xinid, _clkctrl) \
+#define SSPP_BLK(_name, _id, _base, _features, \
+                       _sblk, _xinid, _type, _clkctrl) \
        { \
        .name = _name, .id = _id, \
        .base = _base, .len = 0x1c8, \
-       .features = DMA_SDM845_MASK, \
+       .features = _features, \
        .sblk = &_sblk, \
        .xin_id = _xinid, \
-       .type = SSPP_TYPE_DMA, \
+       .type = _type, \
        .clk_ctrl = _clkctrl \
        }
 
 static struct dpu_sspp_cfg sdm845_sspp[] = {
-       SSPP_VIG_BLK("sspp_0", SSPP_VIG0, 0x4000,
-               sdm845_vig_sblk_0, 0, DPU_CLK_CTRL_VIG0),
-       SSPP_VIG_BLK("sspp_1", SSPP_VIG1, 0x6000,
-               sdm845_vig_sblk_1, 4, DPU_CLK_CTRL_VIG1),
-       SSPP_VIG_BLK("sspp_2", SSPP_VIG2, 0x8000,
-               sdm845_vig_sblk_2, 8, DPU_CLK_CTRL_VIG2),
-       SSPP_VIG_BLK("sspp_3", SSPP_VIG3, 0xa000,
-               sdm845_vig_sblk_3, 12, DPU_CLK_CTRL_VIG3),
-       SSPP_DMA_BLK("sspp_8", SSPP_DMA0, 0x24000,
-               sdm845_dma_sblk_0, 1, DPU_CLK_CTRL_DMA0),
-       SSPP_DMA_BLK("sspp_9", SSPP_DMA1, 0x26000,
-               sdm845_dma_sblk_1, 5, DPU_CLK_CTRL_DMA1),
-       SSPP_DMA_BLK("sspp_10", SSPP_DMA2, 0x28000,
-               sdm845_dma_sblk_2, 9, DPU_CLK_CTRL_CURSOR0),
-       SSPP_DMA_BLK("sspp_11", SSPP_DMA3, 0x2a000,
-               sdm845_dma_sblk_3, 13, DPU_CLK_CTRL_CURSOR1),
+       SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0),
+       SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1),
+       SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2),
+       SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3),
+       SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0),
+       SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1),
+       SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_CURSOR0),
+       SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_CURSOR_SDM845_MASK,
+               sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_CURSOR1),
 };
 
 /*************************************************************
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +5 -3
index 3b17a02..8e2e582 100644
@@ -588,12 +588,13 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 {
        struct drm_device *dev;
        struct drm_plane *primary_planes[MAX_PLANES], *plane;
+       struct drm_plane *cursor_planes[MAX_PLANES] = { NULL };
        struct drm_crtc *crtc;
 
        struct msm_drm_private *priv;
        struct dpu_mdss_cfg *catalog;
 
-       int primary_planes_idx = 0, i, ret;
+       int primary_planes_idx = 0, cursor_planes_idx = 0, i, ret;
        int max_crtc_count;
 
        if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev) {
@@ -632,6 +633,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 
                if (primary)
                        primary_planes[primary_planes_idx++] = plane;
+               if (catalog->sspp[i].features & BIT(DPU_SSPP_CURSOR))
+                       cursor_planes[cursor_planes_idx++] = plane;
 
        }
 
@@ -639,7 +642,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 
        /* Create one CRTC per encoder */
        for (i = 0; i < max_crtc_count; i++) {
-               crtc = dpu_crtc_init(dev, primary_planes[i]);
+               crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i]);
                if (IS_ERR(crtc)) {
                        ret = PTR_ERR(crtc);
                        goto fail;
--
Quoted 3 lines

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

A message that is not in the archive (sent off-list or not yet received): CAF6AEGv_=AO1hYm0sfC5PKgJC1=BUV=m7TjDWRXGbhpONhFHKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#10 lore raw

Re: [DPU PATCH 2/5] drm/msm/dpu: enable cursor plane for primary crtc

Quoted 7 lines · Rob Clark
Quoted 2 lines · Sravanthi Kollukuduru

Reserve one DMA pipe as cursor plane and also, update crtc support of cursor in crtc_init.

hmm, mdp5 in 820 had real cursor planes in hw, did these go away? If so I guess DMA plane is best candidate for cursor..

Hi Rob,
Yes, the hw cursor support is not present on sdm845.
The ozone compositor expects cursor planes to be present otherwise cursor is not rendered on screen. So, we are planning to use one of the DMA pipe for cursor plane.
Thanks,
Rajesh

Quoted 187 lines

BR,
-R

Quoted 183 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c       |  7 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h       |  3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 53 
+++++++++++---------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |  7 +++-
 4 files changed, 34 insertions(+), 36 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +2 -1
index f0aafec..56f6576 100644
@@ -2027,7 +2027,8 @@ static int _dpu_crtc_init_events(struct dpu_crtc 
 *dpu_crtc)
 }
 
 /* initialize crtc */
-struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct 
 drm_plane *plane)
+struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct 
 drm_plane *plane,
+                                               struct drm_plane 

*cursor_plane)

 {
        struct drm_crtc *crtc = NULL;
        struct dpu_crtc *dpu_crtc = NULL;
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +2 -2
@@ -2061,8 +2062,8 @@ struct drm_crtc *dpu_crtc_init(struct drm_device 
 *dev, struct drm_plane *plane)
                                dpu_crtc_frame_event_work);
        }
 
-       drm_crtc_init_with_planes(dev, crtc, plane, NULL, 
 &dpu_crtc_funcs,
-                               NULL);
+       drm_crtc_init_with_planes(dev, crtc, plane,
+                               cursor_plane, &dpu_crtc_funcs, NULL);
 
        drm_crtc_helper_add(crtc, &dpu_crtc_helper_funcs);
        plane->crtc = crtc;
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h +2 -1
index 50c3d4b..b44750d 100644
@@ -366,7 +366,8 @@ void dpu_crtc_complete_commit(struct drm_crtc 
 *crtc,
  * @plane: base plane
  * @Return: new crtc object or error
  */
-struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct 
 drm_plane *plane);
+struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct 
 drm_plane *plane,
+               struct drm_plane *cursor_plane);

/**
* dpu_crtc_cancel_pending_flip - complete flip for clients on
lastclose

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +11 -30
index f0c2881..c0b8116 100644
@@ -29,6 +29,9 @@
        BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
        BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT))
 
+#define DMA_CURSOR_SDM845_MASK \
+       (DMA_SDM845_MASK | BIT(DPU_SSPP_CURSOR))
+
 #define MIXER_SDM845_MASK \
        (BIT(DPU_MIXER_SOURCESPLIT) | BIT(DPU_DIM_LAYER))
 
@@ -169,45 +172,35 @@
 static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 = 
 _DMA_SBLK("10");
 static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = 
 _DMA_SBLK("11");
 
-#define SSPP_VIG_BLK(_name, _id, _base, _sblk, _xinid, _clkctrl) \
-       { \
-       .name = _name, .id = _id, \
-       .base = _base, .len = 0x1c8, \
-       .features = VIG_SDM845_MASK, \
-       .sblk = &_sblk, \
-       .xin_id = _xinid, \
-       .type = SSPP_TYPE_VIG, \
-       .clk_ctrl = _clkctrl \
-       }
-
-#define SSPP_DMA_BLK(_name, _id, _base, _sblk, _xinid, _clkctrl) \
+#define SSPP_BLK(_name, _id, _base, _features, \
+                       _sblk, _xinid, _type, _clkctrl) \
        { \
        .name = _name, .id = _id, \
        .base = _base, .len = 0x1c8, \
-       .features = DMA_SDM845_MASK, \
+       .features = _features, \
        .sblk = &_sblk, \
        .xin_id = _xinid, \
-       .type = SSPP_TYPE_DMA, \
+       .type = _type, \
        .clk_ctrl = _clkctrl \
        }
 
 static struct dpu_sspp_cfg sdm845_sspp[] = {
-       SSPP_VIG_BLK("sspp_0", SSPP_VIG0, 0x4000,
-               sdm845_vig_sblk_0, 0, DPU_CLK_CTRL_VIG0),
-       SSPP_VIG_BLK("sspp_1", SSPP_VIG1, 0x6000,
-               sdm845_vig_sblk_1, 4, DPU_CLK_CTRL_VIG1),
-       SSPP_VIG_BLK("sspp_2", SSPP_VIG2, 0x8000,
-               sdm845_vig_sblk_2, 8, DPU_CLK_CTRL_VIG2),
-       SSPP_VIG_BLK("sspp_3", SSPP_VIG3, 0xa000,
-               sdm845_vig_sblk_3, 12, DPU_CLK_CTRL_VIG3),
-       SSPP_DMA_BLK("sspp_8", SSPP_DMA0, 0x24000,
-               sdm845_dma_sblk_0, 1, DPU_CLK_CTRL_DMA0),
-       SSPP_DMA_BLK("sspp_9", SSPP_DMA1, 0x26000,
-               sdm845_dma_sblk_1, 5, DPU_CLK_CTRL_DMA1),
-       SSPP_DMA_BLK("sspp_10", SSPP_DMA2, 0x28000,
-               sdm845_dma_sblk_2, 9, DPU_CLK_CTRL_CURSOR0),
-       SSPP_DMA_BLK("sspp_11", SSPP_DMA3, 0x2a000,
-               sdm845_dma_sblk_3, 13, DPU_CLK_CTRL_CURSOR1),
+       SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_0, 0, SSPP_TYPE_VIG, 
 DPU_CLK_CTRL_VIG0),
+       SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_1, 4, SSPP_TYPE_VIG, 

DPU_CLK_CTRL_VIG1),

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +2 -0
+       SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_2, 8, SSPP_TYPE_VIG, 

DPU_CLK_CTRL_VIG2),

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +2 -0
+       SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_3, 12, SSPP_TYPE_VIG, 

DPU_CLK_CTRL_VIG3),

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +2 -0
+       SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, 

DPU_CLK_CTRL_DMA0),

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +2 -0
+       SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, 

DPU_CLK_CTRL_DMA1),

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +2 -0
+       SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, 

DPU_CLK_CTRL_CURSOR0),
+ SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000,
DMA_CURSOR_SDM845_MASK,
+ sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA,
DPU_CLK_CTRL_CURSOR1),
};

/*************************************************************

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +2 -1
index 3b17a02..8e2e582 100644
@@ -588,12 +588,13 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms 
 *dpu_kms)
 {
        struct drm_device *dev;
        struct drm_plane *primary_planes[MAX_PLANES], *plane;
+       struct drm_plane *cursor_planes[MAX_PLANES] = { NULL };
        struct drm_crtc *crtc;
 
        struct msm_drm_private *priv;
        struct dpu_mdss_cfg *catalog;
 
-       int primary_planes_idx = 0, i, ret;
+       int primary_planes_idx = 0, cursor_planes_idx = 0, i, ret;
        int max_crtc_count;
 
        if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev) {
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +2 -0
@@ -632,6 +633,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms 
 *dpu_kms)
 
                if (primary)
                        primary_planes[primary_planes_idx++] = plane;
+               if (catalog->sspp[i].features & BIT(DPU_SSPP_CURSOR))
+                       cursor_planes[cursor_planes_idx++] = plane;
 
        }
@@ -639,7 +642,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms 
 *dpu_kms)
 
Quoted 16 lines
Quoted 8 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +1 -1
        /* Create one CRTC per encoder */
        for (i = 0; i < max_crtc_count; i++) {
-               crtc = dpu_crtc_init(dev, primary_planes[i]);
+               crtc = dpu_crtc_init(dev, primary_planes[i], 
 cursor_planes[i]);
                if (IS_ERR(crtc)) {
                        ret = PTR_ERR(crtc);
                        goto fail;
Quoted 4 lines

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

#11 lore raw

Re: [DPU PATCH 2/5] drm/msm/dpu: enable cursor plane for primary crtc

Quoted 9 lines · On Wed, Jun 20, 2018 at 12:29 PM, <[email protected]> wrote:
Quoted 8 lines · Rob Clark
Quoted 3 lines · Sravanthi Kollukuduru

Reserve one DMA pipe as cursor plane and also, update crtc support of cursor in crtc_init.

Quoted 8 lines
Quoted 2 lines

hmm, mdp5 in 820 had real cursor planes in hw, did these go away? If so I guess DMA plane is best candidate for cursor..

Hi Rob,
Yes, the hw cursor support is not present on sdm845.
The ozone compositor expects cursor planes to be present otherwise cursor is not rendered on screen.
So, we are planning to use one of the DMA pipe for cursor plane.

ok, makes sense

BR,
-R

Quoted 202 lines

Thanks,
Rajesh

Quoted 199 lines

BR,
-R

Quoted 186 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c       |  7 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h       |  3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 53
+++++++++++---------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |  7 +++-
 4 files changed, 34 insertions(+), 36 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +2 -1
index f0aafec..56f6576 100644
@@ -2027,7 +2027,8 @@ static int _dpu_crtc_init_events(struct dpu_crtc
 *dpu_crtc)
 }
 
 /* initialize crtc */
-struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane
 *plane)
+struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane
 *plane,
+                                               struct drm_plane

*cursor_plane)

 {
        struct drm_crtc *crtc = NULL;
        struct dpu_crtc *dpu_crtc = NULL;
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +2 -2
@@ -2061,8 +2062,8 @@ struct drm_crtc *dpu_crtc_init(struct drm_device
 *dev, struct drm_plane *plane)
                                dpu_crtc_frame_event_work);
        }
 
-       drm_crtc_init_with_planes(dev, crtc, plane, NULL,
 &dpu_crtc_funcs,
-                               NULL);
+       drm_crtc_init_with_planes(dev, crtc, plane,
+                               cursor_plane, &dpu_crtc_funcs, NULL);
 
        drm_crtc_helper_add(crtc, &dpu_crtc_helper_funcs);
        plane->crtc = crtc;
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h +2 -1
index 50c3d4b..b44750d 100644
@@ -366,7 +366,8 @@ void dpu_crtc_complete_commit(struct drm_crtc *crtc,
  * @plane: base plane
  * @Return: new crtc object or error
  */
-struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane
 *plane);
+struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane
 *plane,
+               struct drm_plane *cursor_plane);
 

/**
* dpu_crtc_cancel_pending_flip - complete flip for clients on lastclose

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +23 -30
index f0c2881..c0b8116 100644
@@ -29,6 +29,9 @@
        BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
        BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT))
 
+#define DMA_CURSOR_SDM845_MASK \
+       (DMA_SDM845_MASK | BIT(DPU_SSPP_CURSOR))
+
 #define MIXER_SDM845_MASK \
        (BIT(DPU_MIXER_SOURCESPLIT) | BIT(DPU_DIM_LAYER))
 
@@ -169,45 +172,35 @@
 static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 =
 _DMA_SBLK("10");
 static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 =
 _DMA_SBLK("11");
 
-#define SSPP_VIG_BLK(_name, _id, _base, _sblk, _xinid, _clkctrl) \
-       { \
-       .name = _name, .id = _id, \
-       .base = _base, .len = 0x1c8, \
-       .features = VIG_SDM845_MASK, \
-       .sblk = &_sblk, \
-       .xin_id = _xinid, \
-       .type = SSPP_TYPE_VIG, \
-       .clk_ctrl = _clkctrl \
-       }
-
-#define SSPP_DMA_BLK(_name, _id, _base, _sblk, _xinid, _clkctrl) \
+#define SSPP_BLK(_name, _id, _base, _features, \
+                       _sblk, _xinid, _type, _clkctrl) \
        { \
        .name = _name, .id = _id, \
        .base = _base, .len = 0x1c8, \
-       .features = DMA_SDM845_MASK, \
+       .features = _features, \
        .sblk = &_sblk, \
        .xin_id = _xinid, \
-       .type = SSPP_TYPE_DMA, \
+       .type = _type, \
        .clk_ctrl = _clkctrl \
        }
 
 static struct dpu_sspp_cfg sdm845_sspp[] = {
-       SSPP_VIG_BLK("sspp_0", SSPP_VIG0, 0x4000,
-               sdm845_vig_sblk_0, 0, DPU_CLK_CTRL_VIG0),
-       SSPP_VIG_BLK("sspp_1", SSPP_VIG1, 0x6000,
-               sdm845_vig_sblk_1, 4, DPU_CLK_CTRL_VIG1),
-       SSPP_VIG_BLK("sspp_2", SSPP_VIG2, 0x8000,
-               sdm845_vig_sblk_2, 8, DPU_CLK_CTRL_VIG2),
-       SSPP_VIG_BLK("sspp_3", SSPP_VIG3, 0xa000,
-               sdm845_vig_sblk_3, 12, DPU_CLK_CTRL_VIG3),
-       SSPP_DMA_BLK("sspp_8", SSPP_DMA0, 0x24000,
-               sdm845_dma_sblk_0, 1, DPU_CLK_CTRL_DMA0),
-       SSPP_DMA_BLK("sspp_9", SSPP_DMA1, 0x26000,
-               sdm845_dma_sblk_1, 5, DPU_CLK_CTRL_DMA1),
-       SSPP_DMA_BLK("sspp_10", SSPP_DMA2, 0x28000,
-               sdm845_dma_sblk_2, 9, DPU_CLK_CTRL_CURSOR0),
-       SSPP_DMA_BLK("sspp_11", SSPP_DMA3, 0x2a000,
-               sdm845_dma_sblk_3, 13, DPU_CLK_CTRL_CURSOR1),
+       SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0),
+       SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1),
+       SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2),
+       SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SDM845_MASK,
+               sdm845_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3),
+       SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0),
+       SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1),
+       SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_SDM845_MASK,
+               sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA,
 DPU_CLK_CTRL_CURSOR0),
+       SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_CURSOR_SDM845_MASK,
+               sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA,

DPU_CLK_CTRL_CURSOR1),
};

/*************************************************************

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +2 -1
index 3b17a02..8e2e582 100644
@@ -588,12 +588,13 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms
 *dpu_kms)
 {
        struct drm_device *dev;
        struct drm_plane *primary_planes[MAX_PLANES], *plane;
+       struct drm_plane *cursor_planes[MAX_PLANES] = { NULL };
        struct drm_crtc *crtc;
 
        struct msm_drm_private *priv;
        struct dpu_mdss_cfg *catalog;
 
-       int primary_planes_idx = 0, i, ret;
+       int primary_planes_idx = 0, cursor_planes_idx = 0, i, ret;
        int max_crtc_count;
 
        if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev) {
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +3 -1
@@ -632,6 +633,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms
 *dpu_kms)
 
                if (primary)
                        primary_planes[primary_planes_idx++] = plane;
+               if (catalog->sspp[i].features & BIT(DPU_SSPP_CURSOR))
+                       cursor_planes[cursor_planes_idx++] = plane;
 
        }
@@ -639,7 +642,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms
 *dpu_kms)
 
        /* Create one CRTC per encoder */
        for (i = 0; i < max_crtc_count; i++) {
-               crtc = dpu_crtc_init(dev, primary_planes[i]);
+               crtc = dpu_crtc_init(dev, primary_planes[i],
 cursor_planes[i]);
                if (IS_ERR(crtc)) {
                        ret = PTR_ERR(crtc);
                        goto fail;
Quoted 5 lines

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel