From: Ilya Bakoulin <ilya.bakou...@amd.com>

[Why]
Need to be able to enable native 422 for debugging purposes.

[How]
Add new dc_debug_options bool and check it in the get_dsc_enc_caps
function.

Signed-off-by: Ilya Bakoulin <ilya.bakou...@amd.com>
Reviewed-by: Charlene Liu <charlene....@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.sique...@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc.h         | 1 +
 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index f30c77e44bb4..3e6133f8cdc4 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -362,6 +362,7 @@ struct dc_debug_options {
        bool disable_hubp_power_gate;
        bool disable_dsc_power_gate;
        int dsc_min_slice_height_override;
+       bool native422_support;
        bool disable_pplib_wm_range;
        enum wm_report_mode pplib_wm_report_mode;
        unsigned int min_disp_clk_khz;
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c 
b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
index dabd3b7a4cdc..ec86ba73a039 100644
--- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
@@ -25,6 +25,7 @@
 #include "dc_hw_types.h"
 #include "dsc.h"
 #include <drm/drm_dp_helper.h>
+#include "dc.h"
 
 struct dc_dsc_policy {
        bool use_min_slices_h;
@@ -236,8 +237,11 @@ static void get_dsc_enc_caps(
        // This is a static HW query, so we can use any DSC
 
        memset(dsc_enc_caps, 0, sizeof(struct dsc_enc_caps));
-       if (dsc)
+       if (dsc) {
                dsc->funcs->dsc_get_enc_caps(dsc_enc_caps, pixel_clock_100Hz);
+               if (dsc->ctx->dc->debug.native422_support)
+                       dsc_enc_caps->color_formats.bits.YCBCR_NATIVE_422 = 1;
+       }
 }
 
 /* Returns 'false' if no intersection was found for at least one capablity.
-- 
2.24.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to