diff --git a/src/amd/vpelib/inc/vpe_types.h b/src/amd/vpelib/inc/vpe_types.h index 4dceadf21b1..d555e3ffb72 100644 --- a/src/amd/vpelib/inc/vpe_types.h +++ b/src/amd/vpelib/inc/vpe_types.h @@ -556,7 +556,6 @@ struct vpe_tonemap_params { uint16_t lut_dim; uint16_t *lut_data; - bool update_3dlut; bool enable_3dlut; }; diff --git a/src/amd/vpelib/src/core/color.c b/src/amd/vpelib/src/core/color.c index afe2f807e35..f89c857475d 100644 --- a/src/amd/vpelib/src/core/color.c +++ b/src/amd/vpelib/src/core/color.c @@ -654,10 +654,13 @@ enum vpe_status vpe_color_update_color_space_and_tf( new_matrix_scaling_factor = vpe_fixpt_one; stream_ctx = &vpe_priv->stream_ctx[stream_idx]; + bool is_3dlut_enable = + stream_ctx->stream.tm_params.UID != 0 || stream_ctx->stream.tm_params.enable_3dlut; + bool require_update = stream_ctx->UID_3DLUT != param->streams[stream_idx].tm_params.UID; color_check_input_cm_update(vpe_priv, stream_ctx, ¶m->streams[stream_idx].surface_info.cs, ¶m->streams[stream_idx].color_adj, - param->streams[stream_idx].tm_params.UID != 0 || param->streams[stream_idx].tm_params.enable_3dlut); + is_3dlut_enable); build_scale_and_bias(stream_ctx->bias_scale, ¶m->streams[stream_idx].surface_info.cs, @@ -686,23 +689,18 @@ enum vpe_status vpe_color_update_color_space_and_tf( } color_update_degamma_tf(vpe_priv, stream_ctx->tf, - vpe_priv->stream_ctx->tf_scaling_factor, - y_scale, - vpe_fixpt_zero, - stream_ctx->stream.tm_params.UID != 0 || stream_ctx->stream.tm_params.enable_3dlut, // By Pass degamma if 3DLUT is enabled + vpe_priv->stream_ctx->tf_scaling_factor, y_scale, vpe_fixpt_zero, + is_3dlut_enable, // By Pass degamma if 3DLUT is enabled stream_ctx->input_tf); } if (stream_ctx->dirty_bits.color_space || output_ctx->dirty_bits.color_space) { status = vpe_color_update_gamut(vpe_priv, stream_ctx->cs, output_ctx->cs, - stream_ctx->gamut_remap, - stream_ctx->stream.tm_params.UID != 0 || stream_ctx->stream.tm_params.enable_3dlut); + stream_ctx->gamut_remap, is_3dlut_enable); } - - if (output_ctx->dirty_bits.transfer_function || - output_ctx->dirty_bits.color_space || - stream_ctx->update_3dlut) { + if (output_ctx->dirty_bits.transfer_function || output_ctx->dirty_bits.color_space || + require_update) { vpe_update_blnd_gamma(vpe_priv, param, &stream_ctx->stream.tm_params, stream_ctx->blend_tf); } } @@ -769,7 +767,7 @@ enum vpe_status vpe_color_update_movable_cm( bool enable_3dlut = stream_ctx->stream.tm_params.UID != 0 || stream_ctx->stream.tm_params.enable_3dlut; - if (stream_ctx->update_3dlut || stream_ctx->UID_3DLUT != stream_ctx->stream.tm_params.UID) { + if (stream_ctx->UID_3DLUT != stream_ctx->stream.tm_params.UID) { uint32_t shaper_norm_factor; struct vpe_color_space tm_out_cs; @@ -832,7 +830,6 @@ enum vpe_status vpe_color_update_movable_cm( vpe_convert_to_tetrahedral(vpe_priv, param->streams[stream_idx].tm_params.lut_data, stream_ctx->lut3d_func, enable_3dlut); - stream_ctx->update_3dlut = false; stream_ctx->UID_3DLUT = param->streams[stream_idx].tm_params.UID; } } diff --git a/src/amd/vpelib/src/core/common.c b/src/amd/vpelib/src/core/common.c index eec20acad09..f6e2abd970e 100644 --- a/src/amd/vpelib/src/core/common.c +++ b/src/amd/vpelib/src/core/common.c @@ -540,15 +540,6 @@ enum vpe_status vpe_check_input_support(struct vpe *vpe, const struct vpe_stream return VPE_STATUS_OK; } -enum vpe_status vpe_cache_tone_map_params( - struct stream_ctx *stream_ctx, const struct vpe_stream *stream) -{ - stream_ctx->update_3dlut = stream_ctx->update_3dlut || stream->tm_params.update_3dlut || - stream->tm_params.UID || (stream_ctx->stream.flags.geometric_scaling != stream->flags.geometric_scaling); - - return VPE_STATUS_OK; -} - enum vpe_status vpe_check_tone_map_support( struct vpe *vpe, const struct vpe_stream *stream, const struct vpe_build_param *param) { diff --git a/src/amd/vpelib/src/core/inc/common.h b/src/amd/vpelib/src/core/inc/common.h index f524fd494b9..b9a552ec1bd 100644 --- a/src/amd/vpelib/src/core/inc/common.h +++ b/src/amd/vpelib/src/core/inc/common.h @@ -81,8 +81,6 @@ enum vpe_status vpe_check_output_support(struct vpe *vpe, const struct vpe_build enum vpe_status vpe_check_input_support(struct vpe *vpe, const struct vpe_stream *stream); -enum vpe_status vpe_cache_tone_map_params(struct stream_ctx *, const struct vpe_stream *stream); - enum vpe_status vpe_check_tone_map_support( struct vpe *vpe, const struct vpe_stream *stream, const struct vpe_build_param *param); diff --git a/src/amd/vpelib/src/core/inc/vpe_priv.h b/src/amd/vpelib/src/core/inc/vpe_priv.h index 0bacdd918d0..649eabc17ab 100644 --- a/src/amd/vpelib/src/core/inc/vpe_priv.h +++ b/src/amd/vpelib/src/core/inc/vpe_priv.h @@ -128,7 +128,6 @@ struct stream_ctx { enum color_transfer_func tf; enum color_space cs; bool enable_3dlut; - bool update_3dlut; uint64_t UID_3DLUT; // UID for current 3D LUT params union { diff --git a/src/amd/vpelib/src/core/vpelib.c b/src/amd/vpelib/src/core/vpelib.c index 9c8cb2fd045..a8236e40ee2 100644 --- a/src/amd/vpelib/src/core/vpelib.c +++ b/src/amd/vpelib/src/core/vpelib.c @@ -392,14 +392,6 @@ enum vpe_status vpe_check_support( if (!vpe_priv->stream_ctx) status = VPE_STATUS_NO_MEMORY; - // VPElib needs to cache whether or not the 3DLUT has been updated - // This is to deal with case when 3DLUT has been updated but VPE rejects the job. - // Need a sticky bit to tell vpe to program the 3dlut on next jobs submission even - // if 3dlut has not changed - for (i = 0; i < param->num_streams; i++) { - vpe_cache_tone_map_params(&vpe_priv->stream_ctx[i], ¶m->streams[i]); - } - if (status == VPE_STATUS_OK) { // output checking - check per asic support status = vpe_check_output_support(vpe, param);