Commit 3967ab83 authored by Joshua Aberback's avatar Joshua Aberback Committed by Alex Deucher
Browse files

drm/amd/display: Restore full update for tiling change to linear



[Why]
There was previously a dc debug flag to indicate that tiling
changes should only be a medium update instead of full. The
function get_plane_info_type was refactored to not rely on dc
state, but in the process the logic was unintentionally changed,
which leads to screen corruption in some cases.

[How]
 - add flag to tiling struct to avoid full update when necessary

Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: default avatarAric Cyr <aric.cyr@amd.com>
Signed-off-by: default avatarJoshua Aberback <joshua.aberback@amd.com>
Signed-off-by: default avatarChuanyu Tseng <chuanyu.tseng@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 94cd4c4d
Loading
Loading
Loading
Loading
+5 −21
Original line number Diff line number Diff line
@@ -2769,29 +2769,13 @@ static struct surface_update_descriptor get_plane_info_update_type(const struct

	if (memcmp(tiling, &u->surface->tiling_info, sizeof(*tiling)) != 0) {
		update_flags->bits.swizzle_change = 1;
		elevate_update_type(&update_type, UPDATE_TYPE_MED, LOCK_DESCRIPTOR_STREAM);

		switch (tiling->gfxversion) {
		case DcGfxVersion9:
		case DcGfxVersion10:
		case DcGfxVersion11:
			if (tiling->gfx9.swizzle != DC_SW_LINEAR) {
				update_flags->bits.bandwidth_change = 1;
				elevate_update_type(&update_type, UPDATE_TYPE_FULL, LOCK_DESCRIPTOR_GLOBAL);
			}
			break;
		case DcGfxAddr3:
			if (tiling->gfx_addr3.swizzle != DC_ADDR3_SW_LINEAR) {
		if (tiling->flags.avoid_full_update_on_tiling_change) {
			elevate_update_type(&update_type, UPDATE_TYPE_MED, LOCK_DESCRIPTOR_STREAM);
		} else {
			update_flags->bits.bandwidth_change = 1;
			elevate_update_type(&update_type, UPDATE_TYPE_FULL, LOCK_DESCRIPTOR_GLOBAL);
		}
			break;
		case DcGfxVersion7:
		case DcGfxVersion8:
		case DcGfxVersionUnknown:
		default:
			break;
		}
	}

	/* This should be UPDATE_TYPE_FAST if nothing has changed. */
+4 −0
Original line number Diff line number Diff line
@@ -445,6 +445,10 @@ enum dc_gfxversion {
			enum swizzle_mode_addr3_values swizzle;
		} gfx_addr3;/*gfx with addr3 and above*/
	};

	struct {
		bool avoid_full_update_on_tiling_change;
	} flags;
};

/* Rotation angle */