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

Commit 3f00fb4a authored by Jin Li's avatar Jin Li
Browse files

drm/sde: assign different default zpos for each plane



zpos is a customized plane property. Not all of DRM client will set
it. Driver needs to assign correct default zpos value for each plane
in order to support blend stage for hardware.

Change-Id: I3f463ba5556c50488bf8bec9c40c578c2e65bd5d
Signed-off-by: default avatarJin Li <jinl@codeaurora.org>
parent 68f681b4
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -865,7 +865,8 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc,
	struct drm_plane *plane;
	struct drm_display_mode *mode;

	int cnt = 0, rc = 0, mixer_width, i, z_pos;
	int cnt = 0, rc = 0, mixer_width, i, z_pos_cur, z_pos_prev = 0;
	int z_pos = 0;
	int left_crtc_zpos_cnt[SDE_STAGE_MAX] = {0};
	int right_crtc_zpos_cnt[SDE_STAGE_MAX] = {0};

@@ -911,8 +912,11 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc,
	sort(pstates, cnt, sizeof(pstates[0]), pstate_cmp, NULL);

	for (i = 0; i < cnt; i++) {
		z_pos = sde_plane_get_property(pstates[i].sde_pstate,
		z_pos_cur = sde_plane_get_property(pstates[i].sde_pstate,
			PLANE_PROP_ZPOS);
		if (z_pos_cur != z_pos_prev)
			z_pos++;
		z_pos_prev = z_pos_cur;

		if (pstates[i].drm_pstate->crtc_x < mixer_width) {
			if (left_crtc_zpos_cnt[z_pos] == 2) {
+4 −1
Original line number Diff line number Diff line
@@ -1116,14 +1116,17 @@ static void _sde_plane_install_properties(struct drm_plane *plane,
	const struct sde_format_extended *format_list;
	struct sde_kms_info *info;
	struct sde_plane *psde = to_sde_plane(plane);
	u32 default_blendstages;

	if (!plane || !psde || !psde->pipe_hw || !psde->pipe_sblk) {
		SDE_ERROR("Invalid argument(s)\n");
		return;
	}

	default_blendstages = plane->type == DRM_PLANE_TYPE_PRIMARY ?
			STAGE_BASE : STAGE0 + drm_plane_index(plane);
	msm_property_install_range(&psde->property_info, "zpos", 0x0, 0,
		max_blendstages, STAGE_BASE, PLANE_PROP_ZPOS);
		max_blendstages, default_blendstages, PLANE_PROP_ZPOS);

	msm_property_install_range(&psde->property_info, "alpha",
		0x0, 0, 255, 255, PLANE_PROP_ALPHA);