[PULL 11/13] ui/dbus: Consistent handling of texture mutex failure

Markus Armbruster posted 13 patches 1 month, 2 weeks ago
Maintainers: Jonathan Cameron <jonathan.cameron@huawei.com>, Fan Ni <fan.ni@samsung.com>, "Michael S. Tsirkin" <mst@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>, Gustavo Romero <gustavo.romero@linaro.org>, Jason Wang <jasowang@redhat.com>, Elena Ufimtseva <elena.ufimtseva@oracle.com>, Jagannathan Raman <jag.raman@oracle.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Stefan Weil <sw@weilnetz.de>, "Daniel P. Berrangé" <berrange@redhat.com>, Steve Sistare <steven.sistare@oracle.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, "Dr. David Alan Gilbert" <dave@treblig.org>, Samuel Thibault <samuel.thibault@ens-lyon.org>, Richard Henderson <richard.henderson@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>
There is a newer version of this series
[PULL 11/13] ui/dbus: Consistent handling of texture mutex failure
Posted by Markus Armbruster 1 month, 2 weeks ago
We report d3d_texture2d_acquire0() and d3d_texture2d_release0()
failure as error, except in dbus_update_gl_cb(), where we report it as
warning.  Report it as error there as well.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20250923091000.3180122-12-armbru@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
---
 ui/dbus-listener.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
index 09d7a319b1..b82e7c7115 100644
--- a/ui/dbus-listener.c
+++ b/ui/dbus-listener.c
@@ -214,26 +214,31 @@ static void dbus_update_gl_cb(GObject *source_object,
                               GAsyncResult *res,
                               gpointer user_data)
 {
-    g_autoptr(GError) err = NULL;
+    g_autoptr(GError) gerr = NULL;
+#ifdef WIN32
+    Error **err = NULL;
+#endif
     DBusDisplayListener *ddl = user_data;
     bool success;
 
 #ifdef CONFIG_GBM
     success = qemu_dbus_display1_listener_call_update_dmabuf_finish(
-        ddl->proxy, res, &err);
+        ddl->proxy, res, &gerr);
     if (!success) {
-        error_report("Failed to call update: %s", err->message);
+        error_report("Failed to call update: %s", gerr->message);
     }
 #endif
 
 #ifdef WIN32
     success = qemu_dbus_display1_listener_win32_d3d11_call_update_texture2d_finish(
-        ddl->d3d11_proxy, res, &err);
+        ddl->d3d11_proxy, res, &gerr);
     if (!success) {
-        error_report("Failed to call update: %s", err->message);
+        error_report("Failed to call update: %s", gerr->message);
     }
 
-    d3d_texture2d_acquire0(ddl->d3d_texture, &error_warn);
+    if (!d3d_texture2d_acquire0(ddl->d3d_texture, &err)) {
+        error_report_err(err);
+    }
 #endif
 
     graphic_hw_gl_block(ddl->dcl.con, false);
-- 
2.49.0


Re: [PULL 11/13] ui/dbus: Consistent handling of texture mutex failure
Posted by Richard Henderson 1 month, 2 weeks ago
On 9/30/25 05:46, Markus Armbruster wrote:
> We report d3d_texture2d_acquire0() and d3d_texture2d_release0()
> failure as error, except in dbus_update_gl_cb(), where we report it as
> warning.  Report it as error there as well.
> 
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Message-ID: <20250923091000.3180122-12-armbru@redhat.com>
> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> ---
>   ui/dbus-listener.c | 17 +++++++++++------
>   1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
> index 09d7a319b1..b82e7c7115 100644
> --- a/ui/dbus-listener.c
> +++ b/ui/dbus-listener.c
> @@ -214,26 +214,31 @@ static void dbus_update_gl_cb(GObject *source_object,
>                                 GAsyncResult *res,
>                                 gpointer user_data)
>   {
> -    g_autoptr(GError) err = NULL;
> +    g_autoptr(GError) gerr = NULL;
> +#ifdef WIN32
> +    Error **err = NULL;
> +#endif
>       DBusDisplayListener *ddl = user_data;
>       bool success;
>   
>   #ifdef CONFIG_GBM
>       success = qemu_dbus_display1_listener_call_update_dmabuf_finish(
> -        ddl->proxy, res, &err);
> +        ddl->proxy, res, &gerr);
>       if (!success) {
> -        error_report("Failed to call update: %s", err->message);
> +        error_report("Failed to call update: %s", gerr->message);
>       }
>   #endif
>   
>   #ifdef WIN32
>       success = qemu_dbus_display1_listener_win32_d3d11_call_update_texture2d_finish(
> -        ddl->d3d11_proxy, res, &err);
> +        ddl->d3d11_proxy, res, &gerr);
>       if (!success) {
> -        error_report("Failed to call update: %s", err->message);
> +        error_report("Failed to call update: %s", gerr->message);
>       }
>   
> -    d3d_texture2d_acquire0(ddl->d3d_texture, &error_warn);
> +    if (!d3d_texture2d_acquire0(ddl->d3d_texture, &err)) {
> +        error_report_err(err);
> +    }
>   #endif

This doesn't build: https://gitlab.com/qemu-project/qemu/-/jobs/11550221970

I think you have one too many * for the declaration of err.


r~

Re: [PULL 11/13] ui/dbus: Consistent handling of texture mutex failure
Posted by Markus Armbruster 1 month, 2 weeks ago
Richard Henderson <richard.henderson@linaro.org> writes:

> On 9/30/25 05:46, Markus Armbruster wrote:
>> We report d3d_texture2d_acquire0() and d3d_texture2d_release0()
>> failure as error, except in dbus_update_gl_cb(), where we report it as
>> warning.  Report it as error there as well.
>> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> Message-ID: <20250923091000.3180122-12-armbru@redhat.com>
>> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
>> ---
>>   ui/dbus-listener.c | 17 +++++++++++------
>>   1 file changed, 11 insertions(+), 6 deletions(-)
>> diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
>> index 09d7a319b1..b82e7c7115 100644
>> --- a/ui/dbus-listener.c
>> +++ b/ui/dbus-listener.c
>> @@ -214,26 +214,31 @@ static void dbus_update_gl_cb(GObject *source_object,
>>                                 GAsyncResult *res,
>>                                 gpointer user_data)
>>   {
>> -    g_autoptr(GError) err = NULL;
>> +    g_autoptr(GError) gerr = NULL;
>> +#ifdef WIN32
>> +    Error **err = NULL;
>> +#endif
>>       DBusDisplayListener *ddl = user_data;
>>       bool success;
>>     #ifdef CONFIG_GBM
>>       success = qemu_dbus_display1_listener_call_update_dmabuf_finish(
>> -        ddl->proxy, res, &err);
>> +        ddl->proxy, res, &gerr);
>>       if (!success) {
>> -        error_report("Failed to call update: %s", err->message);
>> +        error_report("Failed to call update: %s", gerr->message);
>>       }
>>   #endif
>>     #ifdef WIN32
>>       success = qemu_dbus_display1_listener_win32_d3d11_call_update_texture2d_finish(
>> -        ddl->d3d11_proxy, res, &err);
>> +        ddl->d3d11_proxy, res, &gerr);
>>       if (!success) {
>> -        error_report("Failed to call update: %s", err->message);
>> +        error_report("Failed to call update: %s", gerr->message);
>>       }
>>   -    d3d_texture2d_acquire0(ddl->d3d_texture, &error_warn);
>> +    if (!d3d_texture2d_acquire0(ddl->d3d_texture, &err)) {
>> +        error_report_err(err);
>> +    }
>>   #endif
>
> This doesn't build: https://gitlab.com/qemu-project/qemu/-/jobs/11550221970
>
> I think you have one too many * for the declaration of err.

Yup.  Gap in my local MinGW test setup: CONFIG_GBM is off.  Can anyone
tell me offhand which Fedora packages I should install?

Thanks!