Skip to content

Commit

Permalink
drm/amd/display: fix gamma for dpms usecase
Browse files Browse the repository at this point in the history
For dpms usecase we need to set surface transfer function
regardless of gamma set flag.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Roman Li authored and Alex Deucher committed Jan 5, 2017
1 parent be6a420 commit 95772e9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ static void fill_gamma_from_crtc(
{
int i;
struct dc_gamma *gamma;
struct dc_transfer_func *input_tf;
uint16_t *red, *green, *blue;
int end = (crtc->gamma_size > NUM_OF_RAW_GAMMA_RAMP_RGB_256) ?
NUM_OF_RAW_GAMMA_RAMP_RGB_256 : crtc->gamma_size;
Expand All @@ -534,16 +533,6 @@ static void fill_gamma_from_crtc(
}

dc_surface->gamma_correction = gamma;

input_tf = dc_create_transfer_func();

if (input_tf == NULL)
return;

input_tf->type = TF_TYPE_PREDEFINED;
input_tf->tf = TRANSFER_FUNCTION_SRGB;

dc_surface->in_transfer_func = input_tf;
}

static void fill_plane_attributes(
Expand All @@ -554,6 +543,7 @@ static void fill_plane_attributes(
const struct amdgpu_framebuffer *amdgpu_fb =
to_amdgpu_framebuffer(state->fb);
const struct drm_crtc *crtc = state->crtc;
struct dc_transfer_func *input_tf;

fill_rects_from_plane_state(state, surface);
fill_plane_attributes_from_fb(
Expand All @@ -562,6 +552,16 @@ static void fill_plane_attributes(
amdgpu_fb,
addrReq);

input_tf = dc_create_transfer_func();

if (input_tf == NULL)
return;

input_tf->type = TF_TYPE_PREDEFINED;
input_tf->tf = TRANSFER_FUNCTION_SRGB;

surface->in_transfer_func = input_tf;

/* In case of gamma set, update gamma value */
if (crtc->mode.private_flags &
AMDGPU_CRTC_MODE_PRIVATE_FLAGS_GAMMASET) {
Expand Down

0 comments on commit 95772e9

Please sign in to comment.