Module: Mesa
Branch: main
Commit: 28b7c1e61157d9165030d9f2cd293f0eec70c0d9
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=28b7c1e61157d9165030d9f2cd293f0eec70c0d9

Author: Shih, Jude <jude.s...@amd.com>
Date:   Thu Nov 30 10:39:48 2023 +0800

amd/vpelib: Need a debug flag to support 2tap downscaling

Add flag to support 2tap downscaling.

Reviewed-by: Tomson Chang <tomson.ch...@amd.com>
Acked-by: Alan Liu <haoping....@amd.com>
Signed-off-by: Jude Shih <shens...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>

---

 src/amd/vpelib/inc/vpe_types.h                 | 2 ++
 src/amd/vpelib/src/chip/vpe10/vpe10_resource.c | 2 +-
 src/amd/vpelib/src/core/resource.c             | 1 +
 src/amd/vpelib/src/core/vpelib.c               | 3 +++
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/amd/vpelib/inc/vpe_types.h b/src/amd/vpelib/inc/vpe_types.h
index 80e5c8c089f..29d8520f663 100644
--- a/src/amd/vpelib/inc/vpe_types.h
+++ b/src/amd/vpelib/inc/vpe_types.h
@@ -344,6 +344,7 @@ struct vpe_debug_options {
         uint32_t mpc_crc_ctrl            : 1;
         uint32_t bg_bit_depth            : 1;
         uint32_t visual_confirm          : 1;
+        uint32_t skip_optimal_tap_check  : 1;
     } flags;
 
     // valid only if the corresponding flag is set
@@ -365,6 +366,7 @@ struct vpe_debug_options {
     uint32_t dpp_crc_ctrl            : 1;
     uint32_t opp_pipe_crc_ctrl       : 1;
     uint32_t mpc_crc_ctrl            : 1;
+    uint32_t skip_optimal_tap_check  : 1;
     uint32_t bg_bit_depth;
 
     struct vpe_mem_low_power_enable_options enable_mem_low_power;
diff --git a/src/amd/vpelib/src/chip/vpe10/vpe10_resource.c 
b/src/amd/vpelib/src/chip/vpe10/vpe10_resource.c
index 98a414f4e20..fc53c505bbf 100644
--- a/src/amd/vpelib/src/chip/vpe10/vpe10_resource.c
+++ b/src/amd/vpelib/src/chip/vpe10/vpe10_resource.c
@@ -175,7 +175,7 @@ static bool vpe10_init_scaler_data(struct vpe_priv 
*vpe_priv, struct stream_ctx
     struct dpp *dpp = vpe_priv->resource.dpp[0];
     calculate_scaling_ratios(scl_data, src_rect, dst_rect, 
stream_ctx->stream.surface_info.format);
 
-    if (!dpp->funcs->get_optimal_number_of_taps(
+    if (!vpe_priv->init.debug.skip_optimal_tap_check && 
!dpp->funcs->get_optimal_number_of_taps(
             dpp, scl_data, &stream_ctx->stream.scaling_info.taps))
         return false;
 
diff --git a/src/amd/vpelib/src/core/resource.c 
b/src/amd/vpelib/src/core/resource.c
index 8ce0eb18bc7..2b777bc3762 100644
--- a/src/amd/vpelib/src/core/resource.c
+++ b/src/amd/vpelib/src/core/resource.c
@@ -73,6 +73,7 @@ static const struct vpe_debug_options debug_defaults = {
     .dpp_crc_ctrl                            = 0,
     .mpc_crc_ctrl                            = 0,
     .visual_confirm_params                   = {{{0}}},
+    .skip_optimal_tap_check                  = 0,
 };
 
 enum vpe_ip_level vpe_resource_parse_ip_version(
diff --git a/src/amd/vpelib/src/core/vpelib.c b/src/amd/vpelib/src/core/vpelib.c
index fe85fb7f5d1..f3a431fe8db 100644
--- a/src/amd/vpelib/src/core/vpelib.c
+++ b/src/amd/vpelib/src/core/vpelib.c
@@ -113,6 +113,9 @@ static void override_debug_option(
 
     if (user_debug->flags.visual_confirm)
         debug->visual_confirm_params = user_debug->visual_confirm_params;
+
+    if (user_debug->flags.skip_optimal_tap_check)
+        debug->skip_optimal_tap_check = user_debug->skip_optimal_tap_check;
 }
 
 struct vpe *vpe_create(const struct vpe_init_data *params)

Reply via email to