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

Commit df679d93 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: sde: add ubwc p010 support and plane size calculation" into msm-4.9

parents 0f72f180 2ad00bc0
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
@@ -283,6 +283,27 @@ static struct sde_mdp_format_params_ubwc sde_mdp_format_ubwc_map[] = {
			.tile_width = 48,
		},
	},
	{
		.mdp_format = {
			FMT_YUV_COMMON(SDE_PIX_FMT_Y_CBCR_H2V2_P010_UBWC),
			.description = "SDE/Y_CBCR_H2V2_P010_UBWC",
			.flag = 0,
			.fetch_planes = SDE_MDP_PLANE_PSEUDO_PLANAR,
			.chroma_sample = SDE_MDP_CHROMA_420,
			.unpack_count = 2,
			.bpp = 2,
			.frame_format = SDE_MDP_FMT_TILE_A5X,
			.pixel_mode = SDE_MDP_PIXEL_10BIT,
			.element = { C1_B_Cb, C2_R_Cr },
			.unpack_tight = 0,
			.unpack_align_msb = 1,
			.is_ubwc = SDE_MDP_COMPRESS_UBWC
		},
		.micro = {
			.tile_height = 4,
			.tile_width = 32,
		},
	},
	{
		.mdp_format =
			FMT_RGB_1010102(SDE_PIX_FMT_RGBA_1010102_TILE,
@@ -517,6 +538,27 @@ static struct sde_mdp_format_params_ubwc sde_mdp_format_ubwc_map[] = {
			.tile_width = 16,
		},
	},
	{
		.mdp_format = {
			FMT_YUV_COMMON(SDE_PIX_FMT_Y_CBCR_H2V2_P010_TILE),
			.description = "SDE/Y_CBCR_H2V2_P010_TILE",
			.flag = SDE_MDP_FORMAT_FLAG_PRIVATE,
			.fetch_planes = SDE_MDP_PLANE_PSEUDO_PLANAR,
			.chroma_sample = SDE_MDP_CHROMA_420,
			.unpack_count = 2,
			.bpp = 2,
			.frame_format = SDE_MDP_FMT_TILE_A5X,
			.pixel_mode = SDE_MDP_PIXEL_10BIT,
			.element = { C1_B_Cb, C2_R_Cr },
			.unpack_tight = 0,
			.unpack_align_msb = 1,
			.is_ubwc = SDE_MDP_COMPRESS_NONE,
		},
		.micro = {
			.tile_height = 4,
			.tile_width = 32,
		},
	},
};

static struct sde_mdp_format_params sde_mdp_format_map[] = {
@@ -853,6 +895,11 @@ int sde_rot_get_base_tilea5x_pixfmt(u32 src_pixfmt, u32 *dst_pixfmt)
	case SDE_PIX_FMT_BGRX_1010102_TILE:
		*dst_pixfmt = SDE_PIX_FMT_BGRX_1010102_TILE;
		break;
	case SDE_PIX_FMT_Y_CBCR_H2V2_P010:
	case SDE_PIX_FMT_Y_CBCR_H2V2_P010_TILE:
	case SDE_PIX_FMT_Y_CBCR_H2V2_P010_UBWC:
		*dst_pixfmt = SDE_PIX_FMT_Y_CBCR_H2V2_P010_TILE;
		break;
	case SDE_PIX_FMT_Y_CBCR_H2V2_TP10:
	case SDE_PIX_FMT_Y_CBCR_H2V2_TP10_UBWC:
		*dst_pixfmt = SDE_PIX_FMT_Y_CBCR_H2V2_TP10;
+4 −0
Original line number Diff line number Diff line
@@ -280,6 +280,8 @@ static u32 sde_hw_rotator_v4_inpixfmts[] = {
	SDE_PIX_FMT_Y_CBCR_H2V2_P010,
	SDE_PIX_FMT_Y_CBCR_H2V2_TP10,
	SDE_PIX_FMT_Y_CBCR_H2V2_TP10_UBWC,
	SDE_PIX_FMT_Y_CBCR_H2V2_P010_UBWC,
	SDE_PIX_FMT_Y_CBCR_H2V2_P010_TILE,
	SDE_PIX_FMT_Y_CBCR_H2V2_TILE,
	SDE_PIX_FMT_Y_CRCB_H2V2_TILE,
	SDE_PIX_FMT_XRGB_8888_TILE,
@@ -358,6 +360,8 @@ static u32 sde_hw_rotator_v4_outpixfmts[] = {
	SDE_PIX_FMT_Y_CBCR_H2V2_P010,
	SDE_PIX_FMT_Y_CBCR_H2V2_TP10,
	SDE_PIX_FMT_Y_CBCR_H2V2_TP10_UBWC,
	SDE_PIX_FMT_Y_CBCR_H2V2_P010_UBWC,
	SDE_PIX_FMT_Y_CBCR_H2V2_P010_TILE,
	SDE_PIX_FMT_Y_CBCR_H2V2_TILE,
	SDE_PIX_FMT_Y_CRCB_H2V2_TILE,
	SDE_PIX_FMT_XRGB_8888_TILE,
+26 −0
Original line number Diff line number Diff line
@@ -210,6 +210,32 @@ static int sde_mdp_get_a5x_plane_size(struct sde_mdp_format_params *fmt,
		ps->ystride[3] = ALIGN(DIV_ROUND_UP(width / 2, 16), 64);
		ps->plane_size[3] = ALIGN(ps->ystride[3] *
			ALIGN(DIV_ROUND_UP(height / 2, 8), 16), 4096);
	} else if (sde_mdp_is_p010_format(fmt)) {
		ps->num_planes = 2;
		/* Y bitstream stride and plane size */
		ps->ystride[0] = ALIGN(width * 2, 256);
		ps->plane_size[0] = ALIGN(ps->ystride[0] * ALIGN(height, 16),
					4096);

		/* CbCr bitstream stride and plane size */
		ps->ystride[1] = ALIGN(width * 2, 256);
		ps->plane_size[1] = ALIGN(ps->ystride[1] *
			ALIGN(height / 2, 16), 4096);

		if (!sde_mdp_is_ubwc_format(fmt))
			goto done;

		ps->num_planes += 2;

		/* Y meta data stride and plane size */
		ps->ystride[2] = ALIGN(DIV_ROUND_UP(width, 32), 64);
		ps->plane_size[2] = ALIGN(ps->ystride[2] *
			ALIGN(DIV_ROUND_UP(height, 4), 16), 4096);

		/* CbCr meta data stride and plane size */
		ps->ystride[3] = ALIGN(DIV_ROUND_UP(width / 2, 16), 64);
		ps->plane_size[3] = ALIGN(ps->ystride[3] *
			ALIGN(DIV_ROUND_UP(height / 2, 4), 16), 4096);
	} else if (sde_mdp_is_tp10_format(fmt)) {
		u32 yWidth   = sde_mdp_general_align(width, 192);
		u32 yHeight  = ALIGN(height, 16);
+2 −0
Original line number Diff line number Diff line
@@ -1322,6 +1322,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
					descr = "Y/CbCr 4:2:0 P10"; break;
	case V4L2_PIX_FMT_NV12_TP10_UBWC:
					descr = "Y/CbCr 4:2:0 TP10 UBWC"; break;
	case V4L2_PIX_FMT_NV12_P010_UBWC:
					descr = "Y/CbCr 4:2:0 P010 UBWC"; break;

	default:
		/* Compressed formats */
+1 −0
Original line number Diff line number Diff line
@@ -539,6 +539,7 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_NV12_UBWC        v4l2_fourcc('Q', '1', '2', '8')
/* UBWC 10-bit Y/CbCr 4:2:0 */
#define V4L2_PIX_FMT_NV12_TP10_UBWC   v4l2_fourcc('Q', '1', '2', 'A')
#define V4L2_PIX_FMT_NV12_P010_UBWC   v4l2_fourcc('Q', '1', '2', 'B')

/* two non contiguous planes - one Y, one Cr + Cb interleaved  */
#define V4L2_PIX_FMT_NV12M   v4l2_fourcc('N', 'M', '1', '2') /* 12  Y/CbCr 4:2:0  */
Loading