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

Commit 8b1498ab authored by Gopikrishnaiah Anandan's avatar Gopikrishnaiah Anandan Committed by Gerrit - the friendly Code Review server
Browse files

drm: msm: sde: Fix 3d gamut programming sequence



Elements in the struct drm_msm_3d_col needs to be swapped for efficient
programming using the reg dma block. Change swaps the fields in uapi
header and fix couple of issues with disable sequence.

Change-Id: Ieb6f80f4017305ac19a9fb3babfa28f718eda483
Signed-off-by: default avatarGopikrishnaiah Anandan <agopik@codeaurora.org>
parent 457aae19
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ static int sde_cp_disable_crtc_blob_property(struct sde_cp_node *prop_node)
	struct drm_property_blob *blob = prop_node->blob_ptr;

	if (!blob)
		return -EINVAL;
		return 0;
	drm_property_unreference_blob(blob);
	prop_node->blob_ptr = NULL;
	return 0;
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#define GAMUT_MAP_EN BIT(1)
#define GAMUT_EN BIT(0)
#define GAMUT_MODE_13B_OFF 640
#define GAMUT_MODE_5_OFF 1248

enum {
	gamut_mode_17 = 0,
+2 −4
Original line number Diff line number Diff line
@@ -347,10 +347,9 @@ static int sde_gamut_get_mode_info(struct drm_msm_3d_gamut *payload,
		break;
	case GAMUT_3D_MODE_5:
		*tbl_len = GAMUT_3D_MODE5_TBL_SZ * sizeof(u32) * 2;
		*tbl_off = 0;
		*tbl_off = GAMUT_MODE_5_OFF;
		*scale_off = GAMUT_SCALEB_OFFSET_OFF;
		*opcode = gamut_mode_5 << 2;
		*opcode |= GAMUT_MAP_EN;
		break;
	case GAMUT_3D_MODE_13:
		*tbl_len = GAMUT_3D_MODE13_TBL_SZ * sizeof(u32) * 2;
@@ -364,7 +363,6 @@ static int sde_gamut_get_mode_info(struct drm_msm_3d_gamut *payload,
		*scale_off = (*opcode == gamut_mode_13a) ?
			GAMUT_SCALEA_OFFSET_OFF : GAMUT_SCALEB_OFFSET_OFF;
		*opcode <<= 2;
		*opcode |= GAMUT_MAP_EN;
		break;
	default:
		rc = -EINVAL;
@@ -475,7 +473,7 @@ void reg_dmav1_setup_dspp_3d_gamutv4(struct sde_hw_dspp *ctx, void *cfg)
		}
		REG_DMA_SETUP_OPS(dma_write_cfg,
		    ctx->cap->sblk->gamut.base + GAMUT_LOWER_COLOR_OFF,
		    &payload->col[i][0].c0, tbl_len,
		    &payload->col[i][0].c2_c1, tbl_len,
		    REG_BLK_WRITE_MULTIPLE, 2, 0);
		rc = dma_ops->setup_payload(&dma_write_cfg);
		if (rc) {
+1 −1
Original line number Diff line number Diff line
@@ -96,8 +96,8 @@ struct drm_msm_memcol {
 * @c2_c1: Holds c2/c1 values
 */
struct drm_msm_3d_col {
	__u32 c0;
	__u32 c2_c1;
	__u32 c0;
};
/**
 * struct drm_msm_3d_gamut - 3d gamut feature structure