diff mbox series

[2/3] system/vl.c: Expand OpenGL related errors

Message ID 20240731154136.3494621-3-peter.maydell@linaro.org
State New
Headers show
Series virtio-gpu-gl: Improve OpenGL and related display error messages | expand

Commit Message

Peter Maydell July 31, 2024, 3:41 p.m. UTC
Expand the OpenGL related error messages we produce for various
"OpenGL not present/not supported" cases, to hopefully guide the
user towards how to fix things.

Now if the user tries to enable GL on a backend that doesn't
support it the error message is a bit more precise:

$ qemu-system-aarch64 -M virt -device virtio-gpu-gl -display curses,gl=on
qemu-system-aarch64: OpenGL is not supported by display backend 'curses'

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 system/vl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé Aug. 6, 2024, 7:31 a.m. UTC | #1
On 31/7/24 17:41, Peter Maydell wrote:
> Expand the OpenGL related error messages we produce for various
> "OpenGL not present/not supported" cases, to hopefully guide the
> user towards how to fix things.
> 
> Now if the user tries to enable GL on a backend that doesn't
> support it the error message is a bit more precise:
> 
> $ qemu-system-aarch64 -M virt -device virtio-gpu-gl -display curses,gl=on
> qemu-system-aarch64: OpenGL is not supported by display backend 'curses'
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   system/vl.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Alex Bennée Aug. 6, 2024, 1:41 p.m. UTC | #2
Peter Maydell <peter.maydell@linaro.org> writes:

> Expand the OpenGL related error messages we produce for various
> "OpenGL not present/not supported" cases, to hopefully guide the
> user towards how to fix things.
>
> Now if the user tries to enable GL on a backend that doesn't
> support it the error message is a bit more precise:
>
> $ qemu-system-aarch64 -M virt -device virtio-gpu-gl -display curses,gl=on
> qemu-system-aarch64: OpenGL is not supported by display backend 'curses'
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  system/vl.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/system/vl.c b/system/vl.c
> index 9e8f16f1551..213ee6a6a92 100644
> --- a/system/vl.c
> +++ b/system/vl.c
> @@ -1973,9 +1973,10 @@ static void qemu_create_early_backends(void)
>  
>      if (dpy.has_gl && dpy.gl != DISPLAYGL_MODE_OFF && display_opengl == 0) {
>  #if defined(CONFIG_OPENGL)
> -        error_report("OpenGL is not supported by the display");
> +        error_report("OpenGL is not supported by display backend '%s'",
> +                     DisplayType_str(dpy.type));
>  #else
> -        error_report("OpenGL support is disabled");
> +        error_report("OpenGL support was disabled when QEMU was
>      compiled");

Maybe "OpenGL support was not enabled in this build of QEMU"?

Anyway:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>



>  #endif
>          exit(1);
>      }
Antonio Caggiano Aug. 6, 2024, 3:20 p.m. UTC | #3
Hi

On 06/08/2024 15:41, Alex Bennée wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
> 
>> Expand the OpenGL related error messages we produce for various
>> "OpenGL not present/not supported" cases, to hopefully guide the
>> user towards how to fix things.
>>
>> Now if the user tries to enable GL on a backend that doesn't
>> support it the error message is a bit more precise:
>>
>> $ qemu-system-aarch64 -M virt -device virtio-gpu-gl -display curses,gl=on
>> qemu-system-aarch64: OpenGL is not supported by display backend 'curses'
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>>   system/vl.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/system/vl.c b/system/vl.c
>> index 9e8f16f1551..213ee6a6a92 100644
>> --- a/system/vl.c
>> +++ b/system/vl.c
>> @@ -1973,9 +1973,10 @@ static void qemu_create_early_backends(void)
>>   
>>       if (dpy.has_gl && dpy.gl != DISPLAYGL_MODE_OFF && display_opengl == 0) {
>>   #if defined(CONFIG_OPENGL)
>> -        error_report("OpenGL is not supported by the display");
>> +        error_report("OpenGL is not supported by display backend '%s'",
>> +                     DisplayType_str(dpy.type));
>>   #else
>> -        error_report("OpenGL support is disabled");
>> +        error_report("OpenGL support was disabled when QEMU was
>>       compiled");
> 
> Maybe "OpenGL support was not enabled in this build of QEMU"?

To stay aligned with the other changes, this can provide even more 
details with another hint.

"OpenGL support was disabled at QEMU configuration time."
"It can be enabled by running `./configure --enable-opengl` before 
compilation"


BTW, whole series:
Reviewed-by: Antonio Caggiano <quic_acaggian@quicinc.com>

Cheers,
Antonio

> 
> Anyway:
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> 
> 
> 
>>   #endif
>>           exit(1);
>>       }
>
Philippe Mathieu-Daudé Aug. 6, 2024, 7:27 p.m. UTC | #4
On 6/8/24 17:20, Antonio Caggiano wrote:
> Hi
> 
> On 06/08/2024 15:41, Alex Bennée wrote:
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>>> Expand the OpenGL related error messages we produce for various
>>> "OpenGL not present/not supported" cases, to hopefully guide the
>>> user towards how to fix things.
>>>
>>> Now if the user tries to enable GL on a backend that doesn't
>>> support it the error message is a bit more precise:
>>>
>>> $ qemu-system-aarch64 -M virt -device virtio-gpu-gl -display 
>>> curses,gl=on
>>> qemu-system-aarch64: OpenGL is not supported by display backend 'curses'
>>>
>>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>>> ---
>>>   system/vl.c | 5 +++--
>>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/system/vl.c b/system/vl.c
>>> index 9e8f16f1551..213ee6a6a92 100644
>>> --- a/system/vl.c
>>> +++ b/system/vl.c
>>> @@ -1973,9 +1973,10 @@ static void qemu_create_early_backends(void)
>>>       if (dpy.has_gl && dpy.gl != DISPLAYGL_MODE_OFF && 
>>> display_opengl == 0) {
>>>   #if defined(CONFIG_OPENGL)
>>> -        error_report("OpenGL is not supported by the display");
>>> +        error_report("OpenGL is not supported by display backend '%s'",
>>> +                     DisplayType_str(dpy.type));
>>>   #else
>>> -        error_report("OpenGL support is disabled");
>>> +        error_report("OpenGL support was disabled when QEMU was
>>>       compiled");
>>
>> Maybe "OpenGL support was not enabled in this build of QEMU"?
> 
> To stay aligned with the other changes, this can provide even more 
> details with another hint.
> 
> "OpenGL support was disabled at QEMU configuration time."
> "It can be enabled by running `./configure --enable-opengl` before 
> compilation"
> 
> 
> BTW, whole series:
> Reviewed-by: Antonio Caggiano <quic_acaggian@quicinc.com>

Thanks Antonio. I already posted the pull request and it is
being tested. I'll include your R-b tag if there is an issue
and I need to repost it.

> 
> Cheers,
> Antonio
> 
>>
>> Anyway:
>>
>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>>
>>
>>
>>>   #endif
>>>           exit(1);
>>>       }
>>
>
diff mbox series

Patch

diff --git a/system/vl.c b/system/vl.c
index 9e8f16f1551..213ee6a6a92 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1973,9 +1973,10 @@  static void qemu_create_early_backends(void)
 
     if (dpy.has_gl && dpy.gl != DISPLAYGL_MODE_OFF && display_opengl == 0) {
 #if defined(CONFIG_OPENGL)
-        error_report("OpenGL is not supported by the display");
+        error_report("OpenGL is not supported by display backend '%s'",
+                     DisplayType_str(dpy.type));
 #else
-        error_report("OpenGL support is disabled");
+        error_report("OpenGL support was disabled when QEMU was compiled");
 #endif
         exit(1);
     }