[PATCH v10 02/10] virtio-gpu: Use pkgconfig version to decide which virgl features are available

Dmitry Osipenko posted 10 patches 1 year, 9 months ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
There is a newer version of this series
[PATCH v10 02/10] virtio-gpu: Use pkgconfig version to decide which virgl features are available
Posted by Dmitry Osipenko 1 year, 9 months ago
New virglrerenderer features were stabilized with release of v1.0.0.
Presence of symbols in virglrenderer.h doesn't guarantee ABI compatibility
with pre-release development versions of libvirglerender. Use virglrenderer
version to decide reliably which virgl features are available.

Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---
 meson.build | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index 5db2dbc12ec7..f4a4d71c1978 100644
--- a/meson.build
+++ b/meson.build
@@ -2286,11 +2286,8 @@ config_host_data.set('CONFIG_PNG', png.found())
 config_host_data.set('CONFIG_VNC', vnc.found())
 config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
 config_host_data.set('CONFIG_VNC_SASL', sasl.found())
-if virgl.found()
-  config_host_data.set('HAVE_VIRGL_D3D_INFO_EXT',
-                       cc.has_member('struct virgl_renderer_resource_info_ext', 'd3d_tex2d',
-                                     prefix: '#include <virglrenderer.h>',
-                                     dependencies: virgl))
+if virgl.version().version_compare('>=1.0.0')
+  config_host_data.set('HAVE_VIRGL_D3D_INFO_EXT', 1)
 endif
 config_host_data.set('CONFIG_VIRTFS', have_virtfs)
 config_host_data.set('CONFIG_VTE', vte.found())
-- 
2.44.0
Re: [PATCH v10 02/10] virtio-gpu: Use pkgconfig version to decide which virgl features are available
Posted by Marc-André Lureau 1 year, 9 months ago
Hi

On Sun, May 5, 2024 at 12:29 AM Dmitry Osipenko
<dmitry.osipenko@collabora.com> wrote:
>
> New virglrerenderer features were stabilized with release of v1.0.0.
> Presence of symbols in virglrenderer.h doesn't guarantee ABI compatibility
> with pre-release development versions of libvirglerender. Use virglrenderer
> version to decide reliably which virgl features are available.
>
> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> ---
>  meson.build | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 5db2dbc12ec7..f4a4d71c1978 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2286,11 +2286,8 @@ config_host_data.set('CONFIG_PNG', png.found())
>  config_host_data.set('CONFIG_VNC', vnc.found())
>  config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
>  config_host_data.set('CONFIG_VNC_SASL', sasl.found())
> -if virgl.found()
> -  config_host_data.set('HAVE_VIRGL_D3D_INFO_EXT',
> -                       cc.has_member('struct virgl_renderer_resource_info_ext', 'd3d_tex2d',
> -                                     prefix: '#include <virglrenderer.h>',
> -                                     dependencies: virgl))
> +if virgl.version().version_compare('>=1.0.0')
> +  config_host_data.set('HAVE_VIRGL_D3D_INFO_EXT', 1)

If it checks for version >=1.0, we may as well depend on >=1.0.1 imho,
and then simply use VIRGL_CHECK_VERSION in the code.

>  endif
>  config_host_data.set('CONFIG_VIRTFS', have_virtfs)
>  config_host_data.set('CONFIG_VTE', vte.found())
> --
> 2.44.0
>


-- 
Marc-André Lureau
Re: [PATCH v10 02/10] virtio-gpu: Use pkgconfig version to decide which virgl features are available
Posted by Marc-André Lureau 1 year, 9 months ago
Hi

On Tue, May 7, 2024 at 7:18 PM Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Sun, May 5, 2024 at 12:29 AM Dmitry Osipenko
> <dmitry.osipenko@collabora.com> wrote:
> >
> > New virglrerenderer features were stabilized with release of v1.0.0.
> > Presence of symbols in virglrenderer.h doesn't guarantee ABI compatibility
> > with pre-release development versions of libvirglerender. Use virglrenderer
> > version to decide reliably which virgl features are available.
> >
> > Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> > ---
> >  meson.build | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 5db2dbc12ec7..f4a4d71c1978 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -2286,11 +2286,8 @@ config_host_data.set('CONFIG_PNG', png.found())
> >  config_host_data.set('CONFIG_VNC', vnc.found())
> >  config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
> >  config_host_data.set('CONFIG_VNC_SASL', sasl.found())
> > -if virgl.found()
> > -  config_host_data.set('HAVE_VIRGL_D3D_INFO_EXT',
> > -                       cc.has_member('struct virgl_renderer_resource_info_ext', 'd3d_tex2d',
> > -                                     prefix: '#include <virglrenderer.h>',
> > -                                     dependencies: virgl))
> > +if virgl.version().version_compare('>=1.0.0')
> > +  config_host_data.set('HAVE_VIRGL_D3D_INFO_EXT', 1)
>
> If it checks for version >=1.0, we may as well depend on >=1.0.1 imho,
> and then simply use VIRGL_CHECK_VERSION in the code.
>

..but we would need a fallback if VIRGL_CHECK_VERSION isn't defined in
that case (which could simply fail).




-- 
Marc-André Lureau