diff options
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dcn20/dcn20_opp.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn20/dcn20_opp.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_opp.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_opp.c index fbf1b6370eb23..f5fe0cac7cb06 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_opp.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_opp.c @@ -23,6 +23,7 @@ * */ +#include "core_types.h" #include "dm_services.h" #include "dcn20_opp.h" #include "reg_helper.h" @@ -350,19 +351,32 @@ bool opp2_dpg_is_pending(struct output_pixel_processor *opp) return (dpg_en == 1 && double_buffer_pending == 1); } -void opp2_program_left_edge_extra_pixel ( +void opp2_program_left_edge_extra_pixel( struct output_pixel_processor *opp, - bool count) + enum dc_pixel_encoding pixel_encoding, + bool is_primary) { struct dcn20_opp *oppn20 = TO_DCN20_OPP(opp); + uint32_t count = opp2_get_left_edge_extra_pixel_count(opp, pixel_encoding, is_primary); - /* Specifies the number of extra left edge pixels that are supplied to + /* + * Specifies the number of extra left edge pixels that are supplied to * the 422 horizontal chroma sub-sample filter. - * Note that when left edge pixel is not "0", fmt pixel encoding can be in either 420 or 422 mode - * */ + */ REG_UPDATE(FMT_422_CONTROL, FMT_LEFT_EDGE_EXTRA_PIXEL_COUNT, count); } +uint32_t opp2_get_left_edge_extra_pixel_count(struct output_pixel_processor *opp, + enum dc_pixel_encoding pixel_encoding, bool is_primary) +{ + if ((pixel_encoding == PIXEL_ENCODING_YCBCR422 || pixel_encoding == PIXEL_ENCODING_YCBCR420) && + !opp->ctx->dc->debug.force_chroma_subsampling_1tap && + !is_primary) + return 1; + else + return 0; +} + /*****************************************/ /* Constructor, Destructor */ /*****************************************/ @@ -380,6 +394,7 @@ static struct opp_funcs dcn20_opp_funcs = { .opp_dpg_set_blank_color = opp2_dpg_set_blank_color, .opp_destroy = opp1_destroy, .opp_program_left_edge_extra_pixel = opp2_program_left_edge_extra_pixel, + .opp_get_left_edge_extra_pixel_count = opp2_get_left_edge_extra_pixel_count, }; void dcn20_opp_construct(struct dcn20_opp *oppn20, |