Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Disable integerscaling for downscale and MPO

[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>

authored by

Aidan Yang and committed by
Alex Deucher
663bfef0 c09d1d34

+17 -1
+17 -1
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
··· 940 940 941 941 } 942 942 943 + static bool is_downscaled(const struct rect *src_rect, const struct rect *dst_rect) 944 + { 945 + if (src_rect->width > dst_rect->width || src_rect->height > dst_rect->height) 946 + return true; 947 + return false; 948 + } 949 + 950 + static bool is_mpo(int layer_index) 951 + { 952 + if (layer_index > 0) 953 + return true; 954 + return false; 955 + } 956 + 943 957 static void calculate_integer_scaling(struct pipe_ctx *pipe_ctx) 944 958 { 945 959 unsigned int integer_multiple = 1; 946 960 947 - if (pipe_ctx->plane_state->scaling_quality.integer_scaling) { 961 + if (pipe_ctx->plane_state->scaling_quality.integer_scaling && 962 + !is_downscaled(&pipe_ctx->plane_state->src_rect, &pipe_ctx->plane_state->dst_rect) && 963 + !is_mpo(pipe_ctx->plane_state->layer_index)) { 948 964 // calculate maximum # of replication of src onto addressable 949 965 integer_multiple = min( 950 966 pipe_ctx->stream->timing.h_addressable / pipe_ctx->stream->src.width,