From 7668ad7889065bce675957563551b390bddde16a Mon Sep 17 00:00:00 2001
From: Aidan Yang <Aidan.Yang@amd.com>
Date: Wed, 20 Nov 2019 11:05:36 -0500
Subject: drm/amd/display: Disable integerscaling for downscale and MPO
Git-commit: 663bfef0da610da5920df3b030d2aae8e4513baa
Patch-mainline: v5.6-rc1
References: jsc#SLE-12680, jsc#SLE-12880, jsc#SLE-12882, jsc#SLE-12883, jsc#SLE-13496, jsc#SLE-15322
[Why]
Integer scaling is applied to MPO planes when downscaling,
MPO planes use variable taps and integer scaling sets taps=1
[How]
Disable integer scaling on MPO planes,
Disable integer scaling for downscaling planes
Signed-off-by: Aidan Yang <Aidan.Yang@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Patrik Jakobsson <pjakobsson@suse.de>
---
.../gpu/drm/amd/display/dc/core/dc_resource.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 6c6f5640234c..39cc71bedf69 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -940,11 +940,27 @@ static void calculate_inits_and_adj_vp(struct pipe_ctx *pipe_ctx)
}
+static bool is_downscaled(const struct rect *src_rect, const struct rect *dst_rect)
+{
+ if (src_rect->width > dst_rect->width || src_rect->height > dst_rect->height)
+ return true;
+ return false;
+}
+
+static bool is_mpo(int layer_index)
+{
+ if (layer_index > 0)
+ return true;
+ return false;
+}
+
static void calculate_integer_scaling(struct pipe_ctx *pipe_ctx)
{
unsigned int integer_multiple = 1;
- if (pipe_ctx->plane_state->scaling_quality.integer_scaling) {
+ if (pipe_ctx->plane_state->scaling_quality.integer_scaling &&
+ !is_downscaled(&pipe_ctx->plane_state->src_rect, &pipe_ctx->plane_state->dst_rect) &&
+ !is_mpo(pipe_ctx->plane_state->layer_index)) {
// calculate maximum # of replication of src onto addressable
integer_multiple = min(
pipe_ctx->stream->timing.h_addressable / pipe_ctx->stream->src.width,
--
2.28.0