Commit d87dedb1 authored by Josip Pavic's avatar Josip Pavic Committed by Alex Deucher
Browse files

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: default avatarJosip Pavic <Josip.Pavic@amd.com>
Reviewed-by: default avatarKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8d5bc3a5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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]);

		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);