Skip to content

Commit

Permalink
drm/i915: Update color management during vblank evasion.
Browse files Browse the repository at this point in the history
Without this a vblank may occur between updating color management
and planes, which should be prevented.

intel_color_set_csc was called in update pipe config because the
handover from hardware may not have any csc set, which resulted
in a black screen. Because of this also update color management
during fastset.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1459350996-4957-4-git-send-email-maarten.lankhorst@linux.intel.com
[mlankhorst: Remove comment in response to review feedback.]
  • Loading branch information
Maarten Lankhorst committed Mar 31, 2016
1 parent e872ef6 commit 20a34e7
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -3222,9 +3222,6 @@ static void intel_update_pipe_config(struct intel_crtc *crtc,
old_crtc_state->pipe_src_w, old_crtc_state->pipe_src_h,
pipe_config->pipe_src_w, pipe_config->pipe_src_h);

if (HAS_DDI(dev))
intel_color_set_csc(&pipe_config->base);

/*
* Update pipe size and adjust fitter if needed: the reason for this is
* that in compute_mode_changes we check the native mode (not the pfit
Expand Down Expand Up @@ -13591,18 +13588,6 @@ static int intel_atomic_commit(struct drm_device *dev,
dev_priv->display.crtc_enable(crtc);
}

if (!modeset &&
crtc->state->active &&
crtc->state->color_mgmt_changed) {
/*
* Only update color management when not doing
* a modeset as this will be done by
* crtc_enable already.
*/
intel_color_set_csc(crtc->state);
intel_color_load_luts(crtc->state);
}

if (!modeset)
intel_pre_plane_update(to_intel_crtc_state(old_crtc_state));

Expand Down Expand Up @@ -13921,6 +13906,11 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
if (modeset)
return;

if (crtc->state->color_mgmt_changed || to_intel_crtc_state(crtc->state)->update_pipe) {
intel_color_set_csc(crtc->state);
intel_color_load_luts(crtc->state);
}

if (to_intel_crtc_state(crtc->state)->update_pipe)
intel_update_pipe_config(intel_crtc, old_intel_state);
else if (INTEL_INFO(dev)->gen >= 9)
Expand Down

0 comments on commit 20a34e7

Please sign in to comment.