All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/vmwgfx: Propagate error on failed ioctl
@ 2022-03-13  5:06 Philipp Sieweck
  2022-03-25 15:07 ` Javier Martinez Canillas
  2022-03-25 19:28 ` Zack Rusin
  0 siblings, 2 replies; 4+ messages in thread
From: Philipp Sieweck @ 2022-03-13  5:06 UTC (permalink / raw)
  To: linux-graphics-maintainer, zackr, dri-devel; +Cc: Philipp Sieweck

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(+)

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,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/vmwgfx: Propagate error on failed ioctl
  2022-03-13  5:06 [PATCH] drm/vmwgfx: Propagate error on failed ioctl Philipp Sieweck
@ 2022-03-25 15:07 ` Javier Martinez Canillas
  2022-03-25 19:28 ` Zack Rusin
  1 sibling, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2022-03-25 15:07 UTC (permalink / raw)
  To: Philipp Sieweck, linux-graphics-maintainer, zackr, dri-devel

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>

-- 
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/vmwgfx: Propagate error on failed ioctl
  2022-03-13  5:06 [PATCH] drm/vmwgfx: Propagate error on failed ioctl Philipp Sieweck
  2022-03-25 15:07 ` Javier Martinez Canillas
@ 2022-03-25 19:28 ` Zack Rusin
  2022-03-28 16:36   ` Philipp Sieweck
  1 sibling, 1 reply; 4+ messages in thread
From: Zack Rusin @ 2022-03-25 19:28 UTC (permalink / raw)
  To: dri-devel@lists.freedesktop.org, psi@informatik.uni-kiel.de,
	Linux-graphics-maintainer

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/vmwgfx: Propagate error on failed ioctl
  2022-03-25 19:28 ` Zack Rusin
@ 2022-03-28 16:36   ` Philipp Sieweck
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Sieweck @ 2022-03-28 16:36 UTC (permalink / raw)
  To: Zack Rusin; +Cc: Linux-graphics-maintainer, dri-devel@lists.freedesktop.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-28 16:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-13  5:06 [PATCH] drm/vmwgfx: Propagate error on failed ioctl Philipp Sieweck
2022-03-25 15:07 ` Javier Martinez Canillas
2022-03-25 19:28 ` Zack Rusin
2022-03-28 16:36   ` Philipp Sieweck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.