2017-12-13 21:25:39

by Sinclair Yeh

[permalink] [raw]
Subject: Re: [PATCH] 4.15 vmgfx boot warning

Hi Woody,

On Wed, Nov 22, 2017 at 04:05:50PM -0500, Woody Suwalski wrote:
> The 4.15 vmwgfx driver shows a warning during boot (32 bit x86)
> It is caused by a mismatch between the result of vmw_enable_vblank() and
> what the drm_atomic_helper expects:
> ?? /...
> ?? ret = drm_crtc_vblank_get(crtc);
> ?? WARN_ONCE(ret != -EINVAL, "driver forgot to call
> drm_crtc_vblank_off()\n");

This doesn't apply to us because we don't have vblank support, and so
-ENOSYS seems to be the right error.

In the commit message for 84014b0a39ee, it does state a check for this
condition, but the check itself is based on dev->irq_enabled.

Is there another way to check for vblank support?



> ?? /...
>
> Signed-off by: Woody Suwalski <[email protected]>
>
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c?? ?2017-11-22 15:29:46.511674079
> -0500
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c?? ?2017-11-22 15:30:35.344559592
> -0500
> @@ -1869,7 +1869,7 @@ u32 vmw_get_vblank_counter(struct drm_de
> ? */
> ?int vmw_enable_vblank(struct drm_device *dev, unsigned int pipe)
> ?{
> -?? ?return -ENOSYS;
> +?? ?return -EINVAL;
> ?}
>
> ?/**
>


2017-12-16 00:01:42

by Woody Suwalski

[permalink] [raw]
Subject: Re: [PATCH] 4.15 vmgfx boot warning

Sinclair Yeh wrote:
> Hi Woody,
>
> On Wed, Nov 22, 2017 at 04:05:50PM -0500, Woody Suwalski wrote:
>> The 4.15 vmwgfx driver shows a warning during boot (32 bit x86)
>> It is caused by a mismatch between the result of vmw_enable_vblank() and
>> what the drm_atomic_helper expects:
>>    /...
>>    ret = drm_crtc_vblank_get(crtc);
>>    WARN_ONCE(ret != -EINVAL, "driver forgot to call
>> drm_crtc_vblank_off()\n");
> This doesn't apply to us because we don't have vblank support, and so
> -ENOSYS seems to be the right error.
>
> In the commit message for 84014b0a39ee, it does state a check for this
> condition, but the check itself is based on dev->irq_enabled.
>
> Is there another way to check for vblank support?
>
>
>
>>    /...
>>
>> Signed-off by: Woody Suwalski <[email protected]>
>>
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c    2017-11-22 15:29:46.511674079
>> -0500
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c    2017-11-22 15:30:35.344559592
>> -0500
>> @@ -1869,7 +1869,7 @@ u32 vmw_get_vblank_counter(struct drm_de
>>   */
>>  int vmw_enable_vblank(struct drm_device *dev, unsigned int pipe)
>>  {
>> -    return -ENOSYS;
>> +    return -EINVAL;
>>  }
>>
>>  /**
>>
Sinclair, it is a valid stand, so I guess it is time to ask Daniel...

Would it be OK to convert the WARN_ONCE statement in drm_atomic_helper
to recognize ENOSYS as a valid error? Something like

WARN_ONCE((ret != -EINVAL && ret != _ENOSYS), "driver forgot to call
drm_crtc_vblank_off()\n");

Thanks, Woody

2017-12-19 00:26:18

by Woody Suwalski

[permalink] [raw]
Subject: Re: [PATCH v.2] 4.15 vmgfx boot warning

The 4.15 drm_atomic_helper driver shows a warning during boot (both 32
and 64 bit x86)
It is caused by a mismatch between the result of vmw_enable_vblank() and
what the drm_atomic_helper expects:
   /...
   ret = drm_crtc_vblank_get(crtc);
   WARN_ONCE(ret != -EINVAL, "driver forgot to call
drm_crtc_vblank_off()\n");
   /...

Signed-off by: Woody Suwalski <[email protected]>

--- a/drivers/gpu/drm/drm_atomic_helper.c    2017-12-16
09:55:33.853374561 -0500
+++ b/drivers/gpu/drm/drm_atomic_helper.c    2017-12-16
10:55:56.089090752 -0500
@@ -889,7 +889,7 @@ disable_outputs(struct drm_device *dev,
             continue;

         ret = drm_crtc_vblank_get(crtc);
-        WARN_ONCE(ret != -EINVAL, "driver forgot to call
drm_crtc_vblank_off()\n");
+        WARN_ONCE((ret != -EINVAL && ret != -ENOSYS), "driver forgot to
call drm_crtc_vblank_off()\n");
         if (ret == 0)
             drm_crtc_vblank_put(crtc);
     }


Attachments:
040_drm_atomic_helper.patch (498.00 B)

2017-12-19 19:53:39

by Sinclair Yeh

[permalink] [raw]
Subject: Re: [PATCH v.2] 4.15 vmgfx boot warning

This looks okay to me.

On Mon, Dec 18, 2017 at 07:26:03PM -0500, Woody Suwalski wrote:
> The 4.15 drm_atomic_helper driver shows a warning during boot (both 32 and
> 64 bit x86)
> It is caused by a mismatch between the result of vmw_enable_vblank() and
> what the drm_atomic_helper expects:
> ?? /...
> ?? ret = drm_crtc_vblank_get(crtc);
> ?? WARN_ONCE(ret != -EINVAL, "driver forgot to call
> drm_crtc_vblank_off()\n");
> ?? /...
>
> Signed-off by: Woody Suwalski <[email protected]>
>
> --- a/drivers/gpu/drm/drm_atomic_helper.c??? 2017-12-16 09:55:33.853374561
> -0500
> +++ b/drivers/gpu/drm/drm_atomic_helper.c??? 2017-12-16 10:55:56.089090752
> -0500
> @@ -889,7 +889,7 @@ disable_outputs(struct drm_device *dev,
> ???? ??? ??? continue;
>
> ???? ??? ret = drm_crtc_vblank_get(crtc);
> -??? ??? WARN_ONCE(ret != -EINVAL, "driver forgot to call
> drm_crtc_vblank_off()\n");
> +??? ??? WARN_ONCE((ret != -EINVAL && ret != -ENOSYS), "driver forgot to
> call drm_crtc_vblank_off()\n");
> ???? ??? if (ret == 0)
> ???? ??? ??? drm_crtc_vblank_put(crtc);
> ???? }
>

> --- a/drivers/gpu/drm/drm_atomic_helper.c 2017-12-16 09:55:33.853374561 -0500
> +++ b/drivers/gpu/drm/drm_atomic_helper.c 2017-12-16 10:55:56.089090752 -0500
> @@ -889,7 +889,7 @@ disable_outputs(struct drm_device *dev,
> continue;
>
> ret = drm_crtc_vblank_get(crtc);
> - WARN_ONCE(ret != -EINVAL, "driver forgot to call drm_crtc_vblank_off()\n");
> + WARN_ONCE((ret != -EINVAL && ret != -ENOSYS), "driver forgot to call drm_crtc_vblank_off()\n");
> if (ret == 0)
> drm_crtc_vblank_put(crtc);
> }