mirror of
https://github.com/torvalds/linux.git
synced 2026-04-30 20:42:33 -04:00
drm/i915: Implement color management on bdw/skl/bxt/kbl
Patch based on a previous series by Shashank Sharma.
v2: Do not read GAMMA_MODE register to figure what mode we're in
v3: Program PREC_PAL_GC_MAX to clamp pixel values > 1.0
Add documentation on how the Broadcast RGB property is affected by CTM
v4: Update contributors
v5: Refactor degamma/gamma LUTs load into a single function
v6: Fix missing intel_crtc variable (bisect issue)
v7: Fix & simplify limited range matrix multiplication (Matt Roper's
comment)
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Kumar, Kiran S <kiran.s.kumar@intel.com>
Signed-off-by: Kausal Malladi <kausalmalladi@gmail.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acknowledged-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1458125837-2576-4-git-send-email-lionel.g.landwerlin@intel.com
This commit is contained in:
committed by
Matt Roper
parent
05dc698c2e
commit
82cf435b31
@@ -11911,6 +11911,12 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (crtc_state->color_mgmt_changed) {
|
||||
ret = intel_color_check(crtc, crtc_state);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
if (dev_priv->display.compute_pipe_wm) {
|
||||
ret = dev_priv->display.compute_pipe_wm(pipe_config);
|
||||
@@ -11953,7 +11959,6 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,
|
||||
|
||||
static const struct drm_crtc_helper_funcs intel_helper_funcs = {
|
||||
.mode_set_base_atomic = intel_pipe_set_base_atomic,
|
||||
.load_lut = intel_color_load_luts,
|
||||
.atomic_begin = intel_begin_crtc_commit,
|
||||
.atomic_flush = intel_finish_crtc_commit,
|
||||
.atomic_check = intel_crtc_atomic_check,
|
||||
@@ -13576,6 +13581,18 @@ 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);
|
||||
intel_color_load_luts(crtc);
|
||||
}
|
||||
|
||||
if (!modeset)
|
||||
intel_pre_plane_update(to_intel_crtc_state(old_crtc_state));
|
||||
|
||||
@@ -13686,8 +13703,9 @@ out:
|
||||
#undef for_each_intel_crtc_masked
|
||||
|
||||
static const struct drm_crtc_funcs intel_crtc_funcs = {
|
||||
.gamma_set = intel_color_legacy_gamma_set,
|
||||
.gamma_set = drm_atomic_helper_legacy_gamma_set,
|
||||
.set_config = drm_atomic_helper_set_config,
|
||||
.set_property = drm_atomic_helper_crtc_set_property,
|
||||
.destroy = intel_crtc_destroy,
|
||||
.page_flip = intel_crtc_page_flip,
|
||||
.atomic_duplicate_state = intel_crtc_duplicate_state,
|
||||
|
||||
Reference in New Issue
Block a user