diff mbox series

drm/vmwgfx: Propagate error on failed ioctl

Message ID 20220313050655.52199-1-psi@informatik.uni-kiel.de (mailing list archive)
State New, archived
Headers show
Series drm/vmwgfx: Propagate error on failed ioctl | expand

Commit Message

Philipp Sieweck March 13, 2022, 5:06 a.m. UTC
The cases of vmw_user_bo_synccpu_grab failing with -ERESTARTSYS or -EBUSY
are handled in vmw_user_bo_synccpu_ioctl by not printing an error message.
However, the error value gets discarded, indicating success. This leads
to rendering glitches and a reported drm error on the next ioctl call to
release the handle.

This patch propagates the error value from vmw_user_synccpu_grab.

Signed-off-by: Philipp Sieweck <psi@informatik.uni-kiel.de>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Javier Martinez Canillas March 25, 2022, 3:07 p.m. UTC | #1
Hello Philipp,

On 3/13/22 06:06, Philipp Sieweck wrote:
> The cases of vmw_user_bo_synccpu_grab failing with -ERESTARTSYS or -EBUSY
> are handled in vmw_user_bo_synccpu_ioctl by not printing an error message.
> However, the error value gets discarded, indicating success. This leads
> to rendering glitches and a reported drm error on the next ioctl call to
> release the handle.
> 
> This patch propagates the error value from vmw_user_synccpu_grab.
> 
> Signed-off-by: Philipp Sieweck <psi@informatik.uni-kiel.de>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 ++
>  1 file changed, 2 insertions(+)
>

Patch looks good to me.
 
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Zack Rusin March 25, 2022, 7:28 p.m. UTC | #2
On Sun, 2022-03-13 at 06:06 +0100, Philipp Sieweck wrote:
> The cases of vmw_user_bo_synccpu_grab failing with -ERESTARTSYS or -
> EBUSY
> are handled in vmw_user_bo_synccpu_ioctl by not printing an error
> message.
> However, the error value gets discarded, indicating success. This
> leads
> to rendering glitches and a reported drm error on the next ioctl call
> to
> release the handle.
> 
> This patch propagates the error value from vmw_user_synccpu_grab.
> 
> Signed-off-by: Philipp Sieweck <psi@informatik.uni-kiel.de>

Hi, Philipp.

Thanks for the patch. Some questions below.

> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
> index 31aecc46624b..81fe4dc5e6ab 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
> @@ -621,6 +621,8 @@ int vmw_user_bo_synccpu_ioctl(struct drm_device
> *dev, void *data,
>                                   (unsigned int) arg->handle);
>                         return ret;
>                 }
> +               if (unlikely(ret != 0))
> +                       return ret;
>                 break;

I'd just break apart the condition above rather than have two if ret !=
0. What apps do you see glitches in as a result of this? Can you
reproduce it?

z
Philipp Sieweck March 28, 2022, 4:36 p.m. UTC | #3
Hi Zack!

>
> I'd just break apart the condition above rather than have two if ret !=
> 0. What apps do you see glitches in as a result of this? Can you
> reproduce it?
>

There are many apps I can use to trigger this drm error. It occurs more
often on a Wayland-based desktop than on X11. While looking into this,
the most reliable way to trigger it was to open the "About" dialog
window in KeePassXC, then to select the contributors tab, and then to
scroll a bit. The content of the scrolling area is often only partially
updated, which makes the text unreadable.

I tested this on a Windows 10 host with an Intel Iris GPU running the
latest VMware Workstation 16.2. The virtual machine contains a current
Manjaro Linux GNOME desktop with Wayland enabled. 3d acceleration is
active. However, this behavior has been there for quite some time, but
for some reason it is more disruptive today.

Philipp
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
index 31aecc46624b..81fe4dc5e6ab 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
@@ -621,6 +621,8 @@  int vmw_user_bo_synccpu_ioctl(struct drm_device *dev, void *data,
 				  (unsigned int) arg->handle);
 			return ret;
 		}
+		if (unlikely(ret != 0))
+			return ret;
 		break;
 	case drm_vmw_synccpu_release:
 		ret = vmw_user_bo_synccpu_release(file_priv,