diff mbox series

[2/2] drm/i915: Turn off the CUS when turning off a HDR plane

Message ID 20190315195445.26527-2-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915: Fix legacy gamma mode for ICL | expand

Commit Message

Ville Syrjälä March 15, 2019, 7:54 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We're currently leaving the CUS enabled if we disable the
master plane directly after scanning out NV12.

Could perhaps cause the selected slave plane to misbehave
if we try to use it for scanning out something non-NV12?

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_sprite.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Maarten Lankhorst March 18, 2019, 11:04 a.m. UTC | #1
Op 15-03-2019 om 20:54 schreef Ville Syrjala:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We're currently leaving the CUS enabled if we disable the
> master plane directly after scanning out NV12.
>
> Could perhaps cause the selected slave plane to misbehave
> if we try to use it for scanning out something non-NV12?
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_sprite.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index e00559d4cf5a..268fb34ff0e2 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -622,6 +622,9 @@ skl_disable_plane(struct intel_plane *plane,
>  
>  	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>  
> +	if (icl_is_hdr_plane(dev_priv, plane_id))
> +		I915_WRITE_FW(PLANE_CUS_CTL(pipe, plane_id), 0);
> +
>  	skl_write_plane_wm(plane, crtc_state);
>  
>  	I915_WRITE_FW(PLANE_CTL(pipe, plane_id), 0);

Nice catch!

For both:

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Also from CI:

  * {igt@kms_plane@pixel-format-pipe-a-planes-source-clamping}:
    - shard-iclb:         FAIL [fdo#110032] / [fdo#110129] -> PASS

  * {igt@kms_plane@pixel-format-pipe-b-planes-source-clamping}:
    - shard-iclb:         FAIL [fdo#110129] -> PASS +1

  * {igt@kms_plane@pixel-format-pipe-c-planes-source-clamping}:
    - shard-glk:          SKIP [fdo#109271] -> PASS
Maarten Lankhorst March 18, 2019, 11:43 a.m. UTC | #2
Op 18-03-2019 om 12:04 schreef Maarten Lankhorst:
> Op 15-03-2019 om 20:54 schreef Ville Syrjala:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> We're currently leaving the CUS enabled if we disable the
>> master plane directly after scanning out NV12.
>>
>> Could perhaps cause the selected slave plane to misbehave
>> if we try to use it for scanning out something non-NV12?
>>
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_sprite.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
>> index e00559d4cf5a..268fb34ff0e2 100644
>> --- a/drivers/gpu/drm/i915/intel_sprite.c
>> +++ b/drivers/gpu/drm/i915/intel_sprite.c
>> @@ -622,6 +622,9 @@ skl_disable_plane(struct intel_plane *plane,
>>  
>>  	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>>  
>> +	if (icl_is_hdr_plane(dev_priv, plane_id))
>> +		I915_WRITE_FW(PLANE_CUS_CTL(pipe, plane_id), 0);
>> +
>>  	skl_write_plane_wm(plane, crtc_state);
>>  
>>  	I915_WRITE_FW(PLANE_CTL(pipe, plane_id), 0);
> Nice catch!
>
> For both:
>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>
> Also from CI:
>
>   * {igt@kms_plane@pixel-format-pipe-a-planes-source-clamping}:
>     - shard-iclb:         FAIL [fdo#110032] / [fdo#110129] -> PASS
>
>   * {igt@kms_plane@pixel-format-pipe-b-planes-source-clamping}:
>     - shard-iclb:         FAIL [fdo#110129] -> PASS +1
>
>   * {igt@kms_plane@pixel-format-pipe-c-planes-source-clamping}:
>     - shard-glk:          SKIP [fdo#109271] -> PASS
>
Also,

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110032
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index e00559d4cf5a..268fb34ff0e2 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -622,6 +622,9 @@  skl_disable_plane(struct intel_plane *plane,
 
 	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 
+	if (icl_is_hdr_plane(dev_priv, plane_id))
+		I915_WRITE_FW(PLANE_CUS_CTL(pipe, plane_id), 0);
+
 	skl_write_plane_wm(plane, crtc_state);
 
 	I915_WRITE_FW(PLANE_CTL(pipe, plane_id), 0);