Commit 910954da authored by Harmanprit Tatla's avatar Harmanprit Tatla Committed by Alex Deucher

drm/amd/display: Gamma logic limitations causing unintended use of RAM over ROM.

[Why]
Our existing logic in deciding whether to use RAM or ROM
depends on whether we are dealing with an identity gamma ramp.

[How]
In addition to the is_identity flag
a new is_logical_identity flag has been
added. The is_identity flag now denotes
whether the OS gamma is an RGB256 identity
and the new logical identity will inidicate
that the given gamma ramp regardless of its
type is identity.
Signed-off-by: default avatarHarmanprit Tatla <harmanprit.tatla@amd.com>
Reviewed-by: default avatarKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9ed43ef8
......@@ -453,7 +453,11 @@ struct dc_gamma {
/* private to DC core */
struct dc_context *ctx;
/* is_identity is used for RGB256 gamma identity which can also be programmed in INPUT_LUT.
* is_logical_identity indicates the given gamma ramp regardless of type is identity.
*/
bool is_identity;
bool is_logical_identity;
};
/* Used by both ipp amd opp functions*/
......
......@@ -1569,7 +1569,8 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
output_tf->tf == TRANSFER_FUNCTION_SRGB) {
if (ramp == NULL)
return true;
if (ramp->is_identity || (!mapUserRamp && ramp->type == GAMMA_RGB_256))
if ((ramp->is_logical_identity) ||
(!mapUserRamp && ramp->type == GAMMA_RGB_256))
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment