drm/amd/display: remove dc context from transfer function
[Why] The ctx field of dc_transfer_func is not always populated and therefore isn't reliable. [How] Remove dc context from dc_transfer_func Signed-off-by: Josip Pavic <Josip.Pavic@amd.com> Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c44a22b312
commit
ece11e7b4a
@ -123,7 +123,6 @@ static bool dc_stream_construct(struct dc_stream_state *stream,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
stream->out_transfer_func->type = TF_TYPE_BYPASS;
|
stream->out_transfer_func->type = TF_TYPE_BYPASS;
|
||||||
stream->out_transfer_func->ctx = stream->ctx;
|
|
||||||
|
|
||||||
stream->stream_id = stream->ctx->dc_stream_id_count;
|
stream->stream_id = stream->ctx->dc_stream_id_count;
|
||||||
stream->ctx->dc_stream_id_count++;
|
stream->ctx->dc_stream_id_count++;
|
||||||
|
@ -48,22 +48,17 @@ static void dc_plane_construct(struct dc_context *ctx, struct dc_plane_state *pl
|
|||||||
plane_state->in_transfer_func = dc_create_transfer_func();
|
plane_state->in_transfer_func = dc_create_transfer_func();
|
||||||
if (plane_state->in_transfer_func != NULL) {
|
if (plane_state->in_transfer_func != NULL) {
|
||||||
plane_state->in_transfer_func->type = TF_TYPE_BYPASS;
|
plane_state->in_transfer_func->type = TF_TYPE_BYPASS;
|
||||||
plane_state->in_transfer_func->ctx = ctx;
|
|
||||||
}
|
}
|
||||||
plane_state->in_shaper_func = dc_create_transfer_func();
|
plane_state->in_shaper_func = dc_create_transfer_func();
|
||||||
if (plane_state->in_shaper_func != NULL) {
|
if (plane_state->in_shaper_func != NULL) {
|
||||||
plane_state->in_shaper_func->type = TF_TYPE_BYPASS;
|
plane_state->in_shaper_func->type = TF_TYPE_BYPASS;
|
||||||
plane_state->in_shaper_func->ctx = ctx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plane_state->lut3d_func = dc_create_3dlut_func();
|
plane_state->lut3d_func = dc_create_3dlut_func();
|
||||||
if (plane_state->lut3d_func != NULL) {
|
|
||||||
plane_state->lut3d_func->ctx = ctx;
|
|
||||||
}
|
|
||||||
plane_state->blend_tf = dc_create_transfer_func();
|
plane_state->blend_tf = dc_create_transfer_func();
|
||||||
if (plane_state->blend_tf != NULL) {
|
if (plane_state->blend_tf != NULL) {
|
||||||
plane_state->blend_tf->type = TF_TYPE_BYPASS;
|
plane_state->blend_tf->type = TF_TYPE_BYPASS;
|
||||||
plane_state->blend_tf->ctx = ctx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -745,7 +745,6 @@ struct dc_transfer_func {
|
|||||||
enum dc_transfer_func_predefined tf;
|
enum dc_transfer_func_predefined tf;
|
||||||
/* FP16 1.0 reference level in nits, default is 80 nits, only for PQ*/
|
/* FP16 1.0 reference level in nits, default is 80 nits, only for PQ*/
|
||||||
uint32_t sdr_ref_white_level;
|
uint32_t sdr_ref_white_level;
|
||||||
struct dc_context *ctx;
|
|
||||||
union {
|
union {
|
||||||
struct pwl_params pwl;
|
struct pwl_params pwl;
|
||||||
struct dc_transfer_func_distributed_points tf_pts;
|
struct dc_transfer_func_distributed_points tf_pts;
|
||||||
@ -772,7 +771,6 @@ struct dc_3dlut {
|
|||||||
struct tetrahedral_params lut_3d;
|
struct tetrahedral_params lut_3d;
|
||||||
struct fixed31_32 hdr_multiplier;
|
struct fixed31_32 hdr_multiplier;
|
||||||
union dc_3dlut_state state;
|
union dc_3dlut_state state;
|
||||||
struct dc_context *ctx;
|
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* This structure is filled in by dc_surface_get_status and contains
|
* This structure is filled in by dc_surface_get_status and contains
|
||||||
|
@ -325,8 +325,6 @@ bool cm_helper_translate_curve_to_hw_format(
|
|||||||
if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
|
if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PERF_TRACE_CTX(output_tf->ctx);
|
|
||||||
|
|
||||||
corner_points = lut_params->corner_points;
|
corner_points = lut_params->corner_points;
|
||||||
rgb_resulted = lut_params->rgb_resulted;
|
rgb_resulted = lut_params->rgb_resulted;
|
||||||
hw_points = 0;
|
hw_points = 0;
|
||||||
@ -524,8 +522,6 @@ bool cm_helper_translate_curve_to_degamma_hw_format(
|
|||||||
if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
|
if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PERF_TRACE_CTX(output_tf->ctx);
|
|
||||||
|
|
||||||
corner_points = lut_params->corner_points;
|
corner_points = lut_params->corner_points;
|
||||||
rgb_resulted = lut_params->rgb_resulted;
|
rgb_resulted = lut_params->rgb_resulted;
|
||||||
hw_points = 0;
|
hw_points = 0;
|
||||||
|
@ -122,8 +122,6 @@ bool cm3_helper_translate_curve_to_hw_format(
|
|||||||
if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
|
if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PERF_TRACE_CTX(output_tf->ctx);
|
|
||||||
|
|
||||||
corner_points = lut_params->corner_points;
|
corner_points = lut_params->corner_points;
|
||||||
rgb_resulted = lut_params->rgb_resulted;
|
rgb_resulted = lut_params->rgb_resulted;
|
||||||
hw_points = 0;
|
hw_points = 0;
|
||||||
@ -314,8 +312,6 @@ bool cm3_helper_translate_curve_to_degamma_hw_format(
|
|||||||
if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
|
if (output_tf == NULL || lut_params == NULL || output_tf->type == TF_TYPE_BYPASS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PERF_TRACE_CTX(output_tf->ctx);
|
|
||||||
|
|
||||||
corner_points = lut_params->corner_points;
|
corner_points = lut_params->corner_points;
|
||||||
rgb_resulted = lut_params->rgb_resulted;
|
rgb_resulted = lut_params->rgb_resulted;
|
||||||
hw_points = 0;
|
hw_points = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user