diff mbox

[PATCHv3,23/30] drm/omap: fix plane update warning when crtc is disabled

Message ID 1490706496-4959-24-git-send-email-tomi.valkeinen@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomi Valkeinen March 28, 2017, 1:08 p.m. UTC
If omap_plane_atomic_update() is called when the crtc is disabled, and
the timings are zero, we'll see the following warning:

omapdss DISPC error: cannot calculate scaling settings: pclk is zero
omapdrm omapdrm.0: Failed to setup plane vid2

It shouldn't cause any issues, as the crtc is disabled so the plane is
not used by the HW.

To remove the warning, check whether the crtc is enabled at the
beginning of omap_plane_atomic_update(), and bail out if not.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_plane.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Laurent Pinchart March 29, 2017, 10:30 a.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Tuesday 28 Mar 2017 16:08:09 Tomi Valkeinen wrote:
> If omap_plane_atomic_update() is called when the crtc is disabled, and
> the timings are zero, we'll see the following warning:
> 
> omapdss DISPC error: cannot calculate scaling settings: pclk is zero
> omapdrm omapdrm.0: Failed to setup plane vid2
> 
> It shouldn't cause any issues, as the crtc is disabled so the plane is
> not used by the HW.
> 
> To remove the warning, check whether the crtc is enabled at the
> beginning of omap_plane_atomic_update(), and bail out if not.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_plane.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c
> b/drivers/gpu/drm/omapdrm/omap_plane.c index 78a92422ede1..27c1902415de
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_plane.c
> +++ b/drivers/gpu/drm/omapdrm/omap_plane.c
> @@ -86,6 +86,11 @@ static void omap_plane_atomic_update(struct drm_plane
> *plane,
> 
>  	DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb);
> 
> +	if (!state->crtc->state->enable) {
> +		priv->dispc_ops->ovl_enable(omap_plane->id, false);
> +		return;
> +	}

I'm a bit puzzled, why is omap_plane_atomic_update() called for a plane on a 
disabled CRTC ?

>  	memset(&info, 0, sizeof(info));
>  	info.rotation_type = OMAP_DSS_ROT_DMA;
>  	info.rotation = OMAP_DSS_ROT_0;
Tomi Valkeinen March 30, 2017, 10:28 a.m. UTC | #2
On 29/03/17 13:30, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Tuesday 28 Mar 2017 16:08:09 Tomi Valkeinen wrote:
>> If omap_plane_atomic_update() is called when the crtc is disabled, and
>> the timings are zero, we'll see the following warning:
>>
>> omapdss DISPC error: cannot calculate scaling settings: pclk is zero
>> omapdrm omapdrm.0: Failed to setup plane vid2
>>
>> It shouldn't cause any issues, as the crtc is disabled so the plane is
>> not used by the HW.
>>
>> To remove the warning, check whether the crtc is enabled at the
>> beginning of omap_plane_atomic_update(), and bail out if not.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> ---
>>  drivers/gpu/drm/omapdrm/omap_plane.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c
>> b/drivers/gpu/drm/omapdrm/omap_plane.c index 78a92422ede1..27c1902415de
>> 100644
>> --- a/drivers/gpu/drm/omapdrm/omap_plane.c
>> +++ b/drivers/gpu/drm/omapdrm/omap_plane.c
>> @@ -86,6 +86,11 @@ static void omap_plane_atomic_update(struct drm_plane
>> *plane,
>>
>>  	DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb);
>>
>> +	if (!state->crtc->state->enable) {
>> +		priv->dispc_ops->ovl_enable(omap_plane->id, false);
>> +		return;
>> +	}
> 
> I'm a bit puzzled, why is omap_plane_atomic_update() called for a plane on a 
> disabled CRTC ?

I don't remember, and I can't reproduce this on 4.12. Possibly something
has changed since 4.4...

I'll drop this.

 Tomi
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 78a92422ede1..27c1902415de 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -86,6 +86,11 @@  static void omap_plane_atomic_update(struct drm_plane *plane,
 
 	DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb);
 
+	if (!state->crtc->state->enable) {
+		priv->dispc_ops->ovl_enable(omap_plane->id, false);
+		return;
+	}
+
 	memset(&info, 0, sizeof(info));
 	info.rotation_type = OMAP_DSS_ROT_DMA;
 	info.rotation = OMAP_DSS_ROT_0;