mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-11 16:56:14 -04:00
drm/amd/display: add sharpening policy to plane state
[Why] Pass in sharpening policy through plane state from control side [How] Add sharpener support through dc_caps. Add sharpen policy to plane state and move to spl_input. Pass sharpen policy from plane state to SPL. Reviewed-by: Aric Cyr <aric.cyr@amd.com> Signed-off-by: Samson Tam <Samson.Tam@amd.com> Signed-off-by: Roman Li <roman.li@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -227,6 +227,10 @@ struct dc_dmub_caps {
|
||||
uint8_t fams_ver;
|
||||
};
|
||||
|
||||
struct dc_scl_caps {
|
||||
bool sharpener_support;
|
||||
};
|
||||
|
||||
struct dc_caps {
|
||||
uint32_t max_streams;
|
||||
uint32_t max_links;
|
||||
@@ -292,6 +296,7 @@ struct dc_caps {
|
||||
bool sequential_ono;
|
||||
/* Conservative limit for DCC cases which require ODM4:1 to support*/
|
||||
uint32_t dcc_plane_width_limit;
|
||||
struct dc_scl_caps scl_caps;
|
||||
};
|
||||
|
||||
struct dc_bug_wa {
|
||||
@@ -1355,6 +1360,7 @@ struct dc_plane_state {
|
||||
enum mpcc_movable_cm_location mcm_location;
|
||||
struct dc_csc_transform cursor_csc_color_matrix;
|
||||
bool adaptive_sharpness_en;
|
||||
int adaptive_sharpness_policy;
|
||||
int sharpness_level;
|
||||
enum linear_light_scaling linear_light_scaling;
|
||||
unsigned int sdr_white_level_nits;
|
||||
|
||||
@@ -188,7 +188,7 @@ void translate_SPL_in_params_from_pipe_ctx(struct pipe_ctx *pipe_ctx, struct spl
|
||||
spl_in->h_active = pipe_ctx->plane_res.scl_data.h_active;
|
||||
spl_in->v_active = pipe_ctx->plane_res.scl_data.v_active;
|
||||
|
||||
spl_in->debug.sharpen_policy = (enum sharpen_policy)pipe_ctx->stream->ctx->dc->debug.sharpen_policy;
|
||||
spl_in->sharpen_policy = (enum sharpen_policy)plane_state->adaptive_sharpness_policy;
|
||||
spl_in->debug.scale_to_sharpness_policy =
|
||||
(enum scale_to_sharpness_policy)pipe_ctx->stream->ctx->dc->debug.scale_to_sharpness_policy;
|
||||
|
||||
|
||||
@@ -2171,6 +2171,7 @@ static bool dcn401_resource_construct(
|
||||
/* SPL */
|
||||
spl_init_easf_filter_coeffs();
|
||||
spl_init_blur_scale_coeffs();
|
||||
dc->caps.scl_caps.sharpener_support = true;
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
@@ -848,13 +848,13 @@ static bool spl_get_isharp_en(struct spl_in *spl_in,
|
||||
* surfaces based on policy setting
|
||||
*/
|
||||
if (!spl_is_yuv420(spl_in->basic_in.format) &&
|
||||
(spl_in->debug.sharpen_policy == SHARPEN_YUV))
|
||||
(spl_in->sharpen_policy == SHARPEN_YUV))
|
||||
return enable_isharp;
|
||||
else if ((spl_is_yuv420(spl_in->basic_in.format) && !fullscreen) &&
|
||||
(spl_in->debug.sharpen_policy == SHARPEN_RGB_FULLSCREEN_YUV))
|
||||
(spl_in->sharpen_policy == SHARPEN_RGB_FULLSCREEN_YUV))
|
||||
return enable_isharp;
|
||||
else if (!spl_in->is_fullscreen &&
|
||||
spl_in->debug.sharpen_policy == SHARPEN_FULLSCREEN_ALL)
|
||||
spl_in->sharpen_policy == SHARPEN_FULLSCREEN_ALL)
|
||||
return enable_isharp;
|
||||
|
||||
/*
|
||||
|
||||
@@ -508,7 +508,6 @@ struct spl_funcs {
|
||||
struct spl_debug {
|
||||
int visual_confirm_base_offset;
|
||||
int visual_confirm_dpp_offset;
|
||||
enum sharpen_policy sharpen_policy;
|
||||
enum scale_to_sharpness_policy scale_to_sharpness_policy;
|
||||
};
|
||||
|
||||
@@ -530,6 +529,7 @@ struct spl_in {
|
||||
int h_active;
|
||||
int v_active;
|
||||
int sdr_white_level_nits;
|
||||
enum sharpen_policy sharpen_policy;
|
||||
};
|
||||
// end of SPL inputs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user