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

Commit bedc84f4 authored by abeykun's avatar abeykun Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: add tp10 compressed format support



Add MOD_QCOM_TIGHT modifier on top of DRM_FORMAT_NV12
base pixel format and update plane size calculation
to support compressed tp10 buffers.

Change-Id: I12eb9fecfd34d488eda92f6217b6ca51e466c6f6
Signed-off-by: default avatarAlexander Beykun <abeykun@codeaurora.org>
parent be55dab2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -467,6 +467,14 @@ static const struct sde_format sde_format_map_p010_ubwc[] = {
		SDE_FETCH_UBWC, 4),
};

static const struct sde_format sde_format_map_tp10_ubwc[] = {
	PSEUDO_YUV_FMT(NV12,
		0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
		C1_B_Cb, C2_R_Cr,
		SDE_CHROMA_420, (SDE_FORMAT_FLAG_YUV | SDE_FORMAT_FLAG_DX),
		SDE_FETCH_UBWC, 4),
};

/* _sde_get_v_h_subsample_rate - Get subsample rates for all formats we support
 *   Note: Not using the drm_format_*_subsampling since we have formats
 */
@@ -987,6 +995,13 @@ const struct sde_format *sde_get_sde_format_ext(
		map_size = ARRAY_SIZE(sde_format_map_p010_ubwc);
		DBG("found fmt 0x%X DRM_FORMAT_MOD_QCOM_COMPRESSED/DX", format);
		break;
	case (DRM_FORMAT_MOD_QCOM_DX | DRM_FORMAT_MOD_QCOM_COMPRESSED |
		DRM_FORMAT_MOD_QCOM_TIGHT):
		map = sde_format_map_tp10_ubwc;
		map_size = ARRAY_SIZE(sde_format_map_tp10_ubwc);
		DBG("found fmt 0x%X DRM_FORMAT_MOD_QCOM_COMPRESSED/DX/TIGHT",
			format);
		break;
	default:
		DRM_ERROR("unsupported format modifier %llX\n", mod0);
		return NULL;
+8 −0
Original line number Diff line number Diff line
@@ -249,6 +249,14 @@ extern "C" {
 */
#define DRM_FORMAT_MOD_QCOM_DX	fourcc_mod_code(QCOM, 0x2)

/*
 * QTI Tight Format
 *
 * Refers to a tightly packed variant of the base format.
 * Implementation may be platform and base-format specific.
 */
#define DRM_FORMAT_MOD_QCOM_TIGHT	fourcc_mod_code(QCOM, 0x4)

#if defined(__cplusplus)
}
#endif