drm/amd/display: fix use_max_lb flag for 420 pixel formats
authorjsg <jsg@openbsd.org>
Mon, 19 Jul 2021 09:58:16 +0000 (09:58 +0000)
committerjsg <jsg@openbsd.org>
Mon, 19 Jul 2021 09:58:16 +0000 (09:58 +0000)
From Dmytro Laktyushkin
3ca86d44b9023cd96c893d6dd90aacbca90e4d74 in linux 5.10.y/5.10.51
8809a7a4afe90ad9ffb42f72154d27e7c47551ae in mainline linux

sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c

index fce37c5..8bb5912 100644 (file)
@@ -482,10 +482,13 @@ static enum lb_memory_config dpp1_dscl_find_lb_memory_config(struct dcn10_dpp *d
        int vtaps_c = scl_data->taps.v_taps_c;
        int ceil_vratio = dc_fixpt_ceil(scl_data->ratios.vert);
        int ceil_vratio_c = dc_fixpt_ceil(scl_data->ratios.vert_c);
-       enum lb_memory_config mem_cfg = LB_MEMORY_CONFIG_0;
 
-       if (dpp->base.ctx->dc->debug.use_max_lb)
-               return mem_cfg;
+       if (dpp->base.ctx->dc->debug.use_max_lb) {
+               if (scl_data->format == PIXEL_FORMAT_420BPP8
+                               || scl_data->format == PIXEL_FORMAT_420BPP10)
+                       return LB_MEMORY_CONFIG_3;
+               return LB_MEMORY_CONFIG_0;
+       }
 
        dpp->base.caps->dscl_calc_lb_num_partitions(
                        scl_data, LB_MEMORY_CONFIG_1, &num_part_y, &num_part_c);