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

Commit f5d01515 authored by Steve Cohen's avatar Steve Cohen Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: virtual plane validation fixes for tiled formats



Multirect qualified parallel fetch by checking each individual plane
for a tiled format and then imposed the PD_MEM restriction per plane.
Similarly, serial fetch was only checking RECT0 for tiled formats.
This worked for SmartDMA 1.0 since both rectangles had to be the
same format.  Since SmartDMA 2.0 allows for mixed formats, some
logic needed to be enhanced to check if any plane contains a tiled
format before imposing restrictions.

CRs-Fixed: 2082359
Change-Id: Iee7f949687d7b3c3768270dc84a5670c4a39f697
Signed-off-by: default avatarSteve Cohen <cohens@codeaurora.org>
parent 11f5c6aa
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -73,8 +73,6 @@ enum {
	R_MAX
};

#define TX_MODE_BUFFER_LINE_THRES 2

#define SDE_QSEED3_DEFAULT_PRELOAD_H 0x4
#define SDE_QSEED3_DEFAULT_PRELOAD_V 0x3

@@ -2546,14 +2544,28 @@ int sde_plane_validate_multirect_v2(struct sde_multirect_plane_states *plane)
	struct sde_plane *sde_plane[R_MAX];
	const struct sde_format *fmt[R_MAX];
	bool q16_data = true;
	int i, buffer_lines = TX_MODE_BUFFER_LINE_THRES;
	int i, buffer_lines;
	unsigned int max_tile_height = 1;
	bool parallel_fetch_qualified = true;
	bool has_tiled_rect = false;

	for (i = 0; i < R_MAX; i++) {
		const struct msm_format *msm_fmt;
		int width_threshold;

		drm_state[i] = i ? plane->r1 : plane->r0;
		msm_fmt = msm_framebuffer_format(drm_state[i]->fb);
		fmt[i] = to_sde_format(msm_fmt);

		if (SDE_FORMAT_IS_UBWC(fmt[i])) {
			has_tiled_rect = true;
			if (fmt[i]->tile_height > max_tile_height)
				max_tile_height = fmt[i]->tile_height;
		}
	}

	for (i = 0; i < R_MAX; i++) {
		int width_threshold;

		pstate[i] = to_sde_plane_state(drm_state[i]);
		sde_plane[i] = to_sde_plane(drm_state[i]->plane);

@@ -2575,8 +2587,6 @@ int sde_plane_validate_multirect_v2(struct sde_multirect_plane_states *plane)
			return -EINVAL;
		}

		msm_fmt = msm_framebuffer_format(drm_state[i]->fb);
		fmt[i] = to_sde_format(msm_fmt);
		if (SDE_FORMAT_IS_YUV(fmt[i])) {
			SDE_ERROR_PLANE(sde_plane[i],
				"Unsupported format for multirect mode\n");
@@ -2591,7 +2601,7 @@ int sde_plane_validate_multirect_v2(struct sde_multirect_plane_states *plane)
		 * width for tiled formats.
		 */
		width_threshold = sde_plane[i]->pipe_sblk->maxlinewidth;
		if (SDE_FORMAT_IS_UBWC(fmt[i]))
		if (has_tiled_rect)
			width_threshold /= 2;

		if (parallel_fetch_qualified && src[i].w > width_threshold)
@@ -2610,8 +2620,7 @@ int sde_plane_validate_multirect_v2(struct sde_multirect_plane_states *plane)
	}

	/* TIME_MX Mode */
	if (SDE_FORMAT_IS_UBWC(fmt[R0]))
		buffer_lines = 2 * fmt[R0]->tile_height;
	buffer_lines = 2 * max_tile_height;

	if ((dst[R1].y >= dst[R0].y + dst[R0].h + buffer_lines) ||
		(dst[R0].y >= dst[R1].y + dst[R1].h + buffer_lines)) {