提交 d87dedb1 编写于 作者: J Josip Pavic 提交者: Alex Deucher

drm/amd/display: fix regamma build optimization

[Why]
When the global variable pow_buffer_ptr is set to -1, by definition
optimizations should not be used to build the regamma. Since
translate_from_linear_space unconditionally increments this global, it
inadvertently enables the optimization.

[How]
Increment pow_buffer_ptr only if it is not -1.
Signed-off-by: NJosip Pavic <Josip.Pavic@amd.com>
Reviewed-by: NKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: NRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 8d5bc3a5
......@@ -364,8 +364,10 @@ static struct fixed31_32 translate_from_linear_space(
scratch_2 = dc_fixpt_mul(gamma_of_2,
pow_buffer[pow_buffer_ptr%16]);
pow_buffer[pow_buffer_ptr%16] = scratch_2;
pow_buffer_ptr++;
if (pow_buffer_ptr != -1) {
pow_buffer[pow_buffer_ptr%16] = scratch_2;
pow_buffer_ptr++;
}
scratch_1 = dc_fixpt_mul(scratch_1, scratch_2);
scratch_1 = dc_fixpt_sub(scratch_1, args->a2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册