diff mbox

drm: atomic: fix legacy gamma set helper

Message ID 1460371040-25132-1-git-send-email-lionel.g.landwerlin@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lionel Landwerlin April 11, 2016, 10:37 a.m. UTC
Color management properties are a bit of an odd use case because
they're not marked as atomic properties. Currently we're not updating
the non atomic values so the drm_crtc_state is out of sync with the
values stored in the crtc object.

v2: Update non atomic values only if commit succeeds (Bob Paauwe)

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Bob Paauwe <bob.j.paauwe@intel.com>
Cc: <dri-devel@lists.freedesktop.org>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Maarten Lankhorst April 11, 2016, 10:47 a.m. UTC | #1
Op 11-04-16 om 12:37 schreef Lionel Landwerlin:
> Color management properties are a bit of an odd use case because
> they're not marked as atomic properties. Currently we're not updating
> the non atomic values so the drm_crtc_state is out of sync with the
> values stored in the crtc object.
>
> v2: Update non atomic values only if commit succeeds (Bob Paauwe)
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Bob Paauwe <bob.j.paauwe@intel.com>
> Cc: <dri-devel@lists.freedesktop.org>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 7bf678e..65e55ce 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2979,6 +2979,14 @@ retry:
>  	if (ret)
>  		goto fail;
>  
> +	drm_object_property_set_value(&crtc->base,
> +			config->degamma_lut_property, 0);
> +	drm_object_property_set_value(&crtc->base,
> +			config->ctm_property, 0);
> +	drm_object_property_set_value(&crtc->base,
> +			config->gamma_lut_property,
> +			crtc_state->gamma_lut->base.id);
> +
>  	/* Driver takes ownership of state on successful commit. */
>  
>  	drm_property_unreference_blob(blob);
You can't use crtc_state after drm_atomic_commit as it's freed, you need to use crtc->state.
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 7bf678e..65e55ce 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2979,6 +2979,14 @@  retry:
 	if (ret)
 		goto fail;
 
+	drm_object_property_set_value(&crtc->base,
+			config->degamma_lut_property, 0);
+	drm_object_property_set_value(&crtc->base,
+			config->ctm_property, 0);
+	drm_object_property_set_value(&crtc->base,
+			config->gamma_lut_property,
+			crtc_state->gamma_lut->base.id);
+
 	/* Driver takes ownership of state on successful commit. */
 
 	drm_property_unreference_blob(blob);