Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfec52ae authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran Committed by Gerrit - the friendly Code Review server
Browse files

disp: msm: sde: add SID setup function for pipes and lutdma



Add SID setup function to help programming
the SIDs for all the pipes and lutdma xin clients
based on the VM.

Change-Id: Iea598303b480b33de8750e0988129dd5cdfe7572
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent 72453663
Loading
Loading
Loading
Loading
+44 −5
Original line number Diff line number Diff line
@@ -62,8 +62,19 @@

#define DCE_SEL                           0x450

#define ROT_SID_RD			  0x20
#define ROT_SID_WR			  0x24
#define MDP_SID_VIG0			  0x0
#define MDP_SID_VIG1			  0x4
#define MDP_SID_VIG2			  0x8
#define MDP_SID_VIG3			  0xC
#define MDP_SID_DMA0			  0x10
#define MDP_SID_DMA1			  0x14
#define MDP_SID_DMA2			  0x18
#define MDP_SID_DMA3			  0x1C
#define MDP_SID_ROT_RD			  0x20
#define MDP_SID_ROT_WR			  0x24
#define MDP_SID_WB2			  0x28
#define MDP_SID_XIN7			  0x2C

#define ROT_SID_ID_VAL			  0x1c

static void sde_hw_setup_split_pipe(struct sde_hw_mdp *mdp,
@@ -470,10 +481,38 @@ struct sde_hw_sid *sde_hw_sid_init(void __iomem *addr,
	return c;
}

void sde_hw_sid_rotator_set(struct sde_hw_sid *sid)
void sde_hw_set_rotator_sid(struct sde_hw_sid *sid)
{
	SDE_REG_WRITE(&sid->hw, ROT_SID_RD, ROT_SID_ID_VAL);
	SDE_REG_WRITE(&sid->hw, ROT_SID_WR, ROT_SID_ID_VAL);
	if (!sid)
		return;

	SDE_REG_WRITE(&sid->hw, MDP_SID_ROT_RD, ROT_SID_ID_VAL);
	SDE_REG_WRITE(&sid->hw, MDP_SID_ROT_WR, ROT_SID_ID_VAL);
}

void sde_hw_set_sspp_sid(struct sde_hw_sid *sid, u32 pipe, u32 vm)
{
	u32 offset = 0;

	if (!sid)
		return;

	if ((pipe >= SSPP_VIG0) && (pipe <= SSPP_VIG3))
		offset = MDP_SID_VIG0 + ((pipe - SSPP_VIG0) * 4);
	else if ((pipe >= SSPP_DMA0) && (pipe <= SSPP_DMA3))
		offset = MDP_SID_DMA0 + ((pipe - SSPP_DMA0) * 4);
	else
		return;

	SDE_REG_WRITE(&sid->hw, offset, vm << 2);
}

void sde_hw_set_lutdma_sid(struct sde_hw_sid *sid, u32 vm)
{
	if (!sid)
		return;

	SDE_REG_WRITE(&sid->hw, MDP_SID_XIN7, vm << 2);
}

static void sde_hw_program_cwb_ppb_ctrl(struct sde_hw_mdp *mdp,
+18 −3
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ struct sde_hw_sid {
};

/**
 * sde_hw_sid_rotator_set - initialize the sid blk reg map
 * sde_hw_sid_init - initialize the sid blk reg map
 * @addr: Mapped register io address
 * @sid_len: Length of block
 * @m: Pointer to mdss catalog data
@@ -252,10 +252,25 @@ struct sde_hw_sid *sde_hw_sid_init(void __iomem *addr,
		u32 sid_len, const struct sde_mdss_cfg *m);

/**
 * sde_hw_sid_rotator_set - set sid values for rotator
 * sde_hw_set_rotator_sid - set sid values for rotator
 * sid: sde_hw_sid passed from kms
 */
void sde_hw_sid_rotator_set(struct sde_hw_sid *sid);
void sde_hw_set_rotator_sid(struct sde_hw_sid *sid);

/**
 * sde_hw_set_sspp_sid - set sid values for the pipes
 * sid: sde_hw_sid passed from kms
 * pipe: sspp id
 * vm: vm id to set for SIDs
 */
void sde_hw_set_sspp_sid(struct sde_hw_sid *sid, u32 pipe, u32 vm);

/**
 * sde_hw_set_lutdma_sid - set sid values for the pipes
 * sid: sde_hw_sid passed from kms
 * vm: vm id to set for SIDs
 */
void sde_hw_set_lutdma_sid(struct sde_hw_sid *sid, u32 vm);

/**
 * to_sde_hw_mdp - convert base object sde_hw_base to container
+1 −1
Original line number Diff line number Diff line
@@ -2928,7 +2928,7 @@ static void sde_kms_init_shared_hw(struct sde_kms *sde_kms)
						sde_kms->catalog);

	if (sde_kms->sid)
		sde_hw_sid_rotator_set(sde_kms->hw_sid);
		sde_hw_set_rotator_sid(sde_kms->hw_sid);
}

static void _sde_kms_set_lutdma_vbif_remap(struct sde_kms *sde_kms)
+23 −0
Original line number Diff line number Diff line
@@ -233,6 +233,29 @@ void sde_plane_setup_src_split_order(struct drm_plane *plane,
					rect_mode, enable);
}

void sde_plane_set_sid(struct drm_plane *plane, u32 vm)
{
	struct sde_plane *psde;
	struct sde_kms *sde_kms;
	struct msm_drm_private *priv;

	if (!plane || !plane->dev) {
		SDE_ERROR("invalid plane %d\n");
		return;
	}

	priv = plane->dev->dev_private;
	if (!priv || !priv->kms) {
		SDE_ERROR("invalid KMS reference\n");
		return;
	}

	sde_kms = to_sde_kms(priv->kms);

	psde = to_sde_plane(plane);
	sde_hw_set_sspp_sid(sde_kms->hw_sid, psde->pipe, vm);
}

/**
 * _sde_plane_set_qos_lut - set danger, safe and creq LUT of the given plane
 * @plane:		Pointer to drm plane
+7 −0
Original line number Diff line number Diff line
@@ -327,6 +327,13 @@ void sde_plane_clear_ubwc_error(struct drm_plane *plane);
void sde_plane_setup_src_split_order(struct drm_plane *plane,
		enum sde_sspp_multirect_index rect_mode, bool enable);

/*
 * sde_plane_set_sid - set VM SID for the plane
 * @plane: Pointer to DRM plane object
 * @vm: VM id
 */
void sde_plane_set_sid(struct drm_plane *plane, u32 vm);

/* sde_plane_is_cache_required - indicates if the system cache is
 *	required for the plane.
 * @plane: Pointer to DRM plane object