aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorBob Paauwe <bob.j.paauwe@intel.com>2016-07-15 09:59:02 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-07-19 03:17:43 -0400
commitfa95986095e39205ea2fb5b5dafe271bca7eb8d1 (patch)
treeeb387900bbf0eb6fc65ea0858293ac589a007ce4 /drivers/gpu/drm/i915/intel_display.c
parent84c8e0963da434d37355079b568465cd121af295 (diff)
drm/i915: Set legacy properties when using legacy gamma set IOCTL. (v2)
The i915 driver is now using atomic properties and atomic commit to handle the legacy set gamma IOCTL. However, if the driver is configured without atomic (nuclear_pageflip = false), it won't update the legacy properties for degamma_lut, gamma_lut and ctm leaving them out of sync with the atomic version of the properties. Until the driver is full atomic, make sure we update the non-atomic version of the properties. v2: Update the comment with a FIXME. (Daniel) v3: Update arguments of the gamma_set vfunc (Lionel) v4: Fixed vfunc prototype (Lionel) igt-testcase: kms_pipe_color / legacy-gamma-reset-pipeX Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: stable@vger.kernel.org #v4.7 Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1468591142-2253-1-git-send-email-lionel.g.landwerlin@intel.com (cherry picked from commit a87848750ebc2c174879f5acaa1183044287fd03)
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index be3b2cab2640..9f56ac11975f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13918,8 +13918,50 @@ out:
13918 13918
13919#undef for_each_intel_crtc_masked 13919#undef for_each_intel_crtc_masked
13920 13920
13921/*
13922 * FIXME: Remove this once i915 is fully DRIVER_ATOMIC by calling
13923 * drm_atomic_helper_legacy_gamma_set() directly.
13924 */
13925static int intel_atomic_legacy_gamma_set(struct drm_crtc *crtc,
13926 u16 *red, u16 *green, u16 *blue,
13927 uint32_t size)
13928{
13929 struct drm_device *dev = crtc->dev;
13930 struct drm_mode_config *config = &dev->mode_config;
13931 struct drm_crtc_state *state;
13932 int ret;
13933
13934 ret = drm_atomic_helper_legacy_gamma_set(crtc, red, green, blue, size);
13935 if (ret)
13936 return ret;
13937
13938 /*
13939 * Make sure we update the legacy properties so this works when
13940 * atomic is not enabled.
13941 */
13942
13943 state = crtc->state;
13944
13945 drm_object_property_set_value(&crtc->base,
13946 config->degamma_lut_property,
13947 (state->degamma_lut) ?
13948 state->degamma_lut->base.id : 0);
13949
13950 drm_object_property_set_value(&crtc->base,
13951 config->ctm_property,
13952 (state->ctm) ?
13953 state->ctm->base.id : 0);
13954
13955 drm_object_property_set_value(&crtc->base,
13956 config->gamma_lut_property,
13957 (state->gamma_lut) ?
13958 state->gamma_lut->base.id : 0);
13959
13960 return 0;
13961}
13962
13921static const struct drm_crtc_funcs intel_crtc_funcs = { 13963static const struct drm_crtc_funcs intel_crtc_funcs = {
13922 .gamma_set = drm_atomic_helper_legacy_gamma_set, 13964 .gamma_set = intel_atomic_legacy_gamma_set,
13923 .set_config = drm_atomic_helper_set_config, 13965 .set_config = drm_atomic_helper_set_config,
13924 .set_property = drm_atomic_helper_crtc_set_property, 13966 .set_property = drm_atomic_helper_crtc_set_property,
13925 .destroy = intel_crtc_destroy, 13967 .destroy = intel_crtc_destroy,