Re: [Patch]: Integrate VA-API into xenocara
On Fri, Jan 24, 2020 at 04:45:07PM +1100, Jonathan Gray wrote: > On Thu, Jan 23, 2020 at 12:39:29PM +1100, Jonathan Gray wrote: > > On Wed, Dec 18, 2019 at 03:28:48PM -0600, Brad DeMorrow wrote: > > > This is a rather large patch that moves my previously submitted > > > VA-API ports into xenocara. For your convenience, I've inlined > > > a diff that shows you all of the changes I made to existing files > > > that you can easily read in your MUA. The attached patch also > > > contains these changes and should be the only xenocara patch > > > you need to apply. > > > > > > Summary of Changes: > > > - libva added to xenocara/lib/libva > > > - vainfo added to xenocara/app/vainfo > > > - intel-vaapi-driver added to xenocara/driver/intel-vaapi-driver > > > - Mesa Makefile.bsd-wrapper updated to build with --enable-va flag > > > - 3RDPARTY file updated to include libva, libva-utils, and > > > intel-vaapi-driver > > > - BSD.x11.dist updated to include /usr/X11R6/include/va/ (separate patch) > > > > It is difficult to see where you have made changes, can you send patches > > against source from particular tarballs? > > I built libva-2.6.1 but it does not work with non-intel drivers at > runtime due to a Mesa bug: > > https://bugs.freedesktop.org/show_bug.cgi?id=109929 > > libva info: VA-API version 1.6.0 > libva info: Trying to open /usr/X11R6/lib/dri/radeonsi_drv_video.so > vainfo:/usr/X11R6/lib/dri/radeonsi_drv_video.so: undefined symbol > 'gl_nir_lower_samplers_as_deref' > vainfo:/usr/X11R6/lib/dri/radeonsi_drv_video.so: undefined symbol > 'gl_nir_lower_samplers' > libva error: dlopen of /usr/X11R6/lib/dri/radeonsi_drv_video.so failed: > Cannot load specified object > libva info: va_openDriver() returns -1 > vaInitialize failed with error code -1 (unknown libva error),exit If I backport the following commits to 19.2 vainfo no longer errors on amdgpu. libva info: VA-API version 1.6.0 libva info: Trying to open /usr/X11R6/lib/dri/radeonsi_drv_video.so libva info: Found init function __vaDriverInit_1_6 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.6 (libva 2.6.1) vainfo: Driver version: Mesa Gallium driver 19.2.8 for AMD RAVEN (DRM 3.27.0, 6.6, LLVM 8.0.1) vainfo: Supported profile and entrypoints VAProfileMPEG2Simple: VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main: VAEntrypointVLD VAProfileVC1Advanced: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain10 : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointVLD VAProfileVP9Profile0: VAEntrypointVLD VAProfileVP9Profile2: VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc commit 3debd0ef157ed614522d20c1735c38af42fcce30 Author: Timur Kristóf AuthorDate: Wed Sep 4 16:56:09 2019 +0300 Commit: Timur Kristóf CommitDate: Fri Sep 6 12:20:53 2019 +0300 tgsi_to_nir: Remove dependency on libglsl. This commit removes the GLSL dependency in TTN by manually recording the textures used and calling nir_lower_samplers instead of its GL counterpart. Signed-off-by: Timur Kristóf Reviewed-by: Connor Abbott commit 610cc3089ccf1bce3ad025f308b6f408e8e90920 Author: Timur Kristóf AuthorDate: Wed Aug 28 22:34:14 2019 +0200 Commit: Timur Kristóf CommitDate: Fri Sep 6 12:20:20 2019 +0300 nir: Carve out nir_lower_samplers from GLSL code. Lowering samplers is needed to produce NIR that can actually be consumed by some gallium drivers, so it doesn't make sense to to keep it only in the GLSL code. This commit introduces nir_lower_samplers to compiler/nir, while maintains the GL-specific function too. Signed-off-by: Timur Kristóf Reviewed-by: Connor Abbott Index: Makefile.bsd-wrapper === RCS file: /cvs/xenocara/lib/mesa/Makefile.bsd-wrapper,v retrieving revision 1.29 diff -u -p -r1.29 Makefile.bsd-wrapper --- Makefile.bsd-wrapper22 Jan 2020 02:49:17 - 1.29 +++ Makefile.bsd-wrapper25 Jan 2020 02:29:19 - @@ -44,6 +44,7 @@ CONFIGURE_ARGS= --with-dri-drivers=${DR --enable-gbm \ --enable-texture-float \ --enable-autotools \ + --enable-va \ --with-
Re: [Patch]: Integrate VA-API into xenocara
On Fri, Jan 24, 2020 at 04:45:07PM +1100, Jonathan Gray wrote: > On Thu, Jan 23, 2020 at 12:39:29PM +1100, Jonathan Gray wrote: > > On Wed, Dec 18, 2019 at 03:28:48PM -0600, Brad DeMorrow wrote: > > > This is a rather large patch that moves my previously submitted > > > VA-API ports into xenocara. For your convenience, I've inlined > > > a diff that shows you all of the changes I made to existing files > > > that you can easily read in your MUA. The attached patch also > > > contains these changes and should be the only xenocara patch > > > you need to apply. > > > > > > Summary of Changes: > > > - libva added to xenocara/lib/libva > > > - vainfo added to xenocara/app/vainfo > > > - intel-vaapi-driver added to xenocara/driver/intel-vaapi-driver > > > - Mesa Makefile.bsd-wrapper updated to build with --enable-va flag > > > - 3RDPARTY file updated to include libva, libva-utils, and > > > intel-vaapi-driver > > > - BSD.x11.dist updated to include /usr/X11R6/include/va/ (separate patch) > > > > It is difficult to see where you have made changes, can you send patches > > against source from particular tarballs? > > I built libva-2.6.1 but it does not work with non-intel drivers at > runtime due to a Mesa bug: > > https://bugs.freedesktop.org/show_bug.cgi?id=109929 > > libva info: VA-API version 1.6.0 > libva info: Trying to open /usr/X11R6/lib/dri/radeonsi_drv_video.so > vainfo:/usr/X11R6/lib/dri/radeonsi_drv_video.so: undefined symbol > 'gl_nir_lower_samplers_as_deref' > vainfo:/usr/X11R6/lib/dri/radeonsi_drv_video.so: undefined symbol > 'gl_nir_lower_samplers' > libva error: dlopen of /usr/X11R6/lib/dri/radeonsi_drv_video.so failed: > Cannot load specified object > libva info: va_openDriver() returns -1 > vaInitialize failed with error code -1 (unknown libva error),exit > > Here is the diff for libva-2.6.1 from memory the horrible ifdef part > came from FreeBSD via your port. patch below for va-utils it installs quite a few binaries /usr/X11R6/bin/avcenc /usr/X11R6/bin/avcstreamoutdemo /usr/X11R6/bin/h264encode /usr/X11R6/bin/hevcencode /usr/X11R6/bin/jpegenc /usr/X11R6/bin/loadjpeg /usr/X11R6/bin/mpeg2vaenc /usr/X11R6/bin/mpeg2vldemo /usr/X11R6/bin/putsurface /usr/X11R6/bin/sfcsample /usr/X11R6/bin/vainfo /usr/X11R6/bin/vavpp /usr/X11R6/bin/vp8enc /usr/X11R6/bin/vp9enc /usr/X11R6/bin/vppblending /usr/X11R6/bin/vppchromasitting /usr/X11R6/bin/vppdenoise /usr/X11R6/bin/vppscaling_csc /usr/X11R6/bin/vppscaling_n_ --- /dev/null Fri Jan 24 16:43:41 2020 +++ libva-utils-2.6.0/Makefile.bsd-wrapper Fri Jan 24 14:02:34 2020 @@ -0,0 +1,3 @@ +# $OpenBSD$ + +.include diff -upr -x *.m4 -x Makefile.in libva-utils-2.6.0.orig/encode/jpegenc_utils.h libva-utils-2.6.0/encode/jpegenc_utils.h --- libva-utils-2.6.0.orig/encode/jpegenc_utils.h Wed Dec 26 21:29:26 2018 +++ libva-utils-2.6.0/encode/jpegenc_utils.hFri Jan 24 14:06:25 2020 @@ -50,7 +50,7 @@ struct __bitstream { typedef struct __bitstream bitstream; static unsigned int -swap32(unsigned int val) +va_swap32(unsigned int val) { unsigned char *pval = (unsigned char *)&val; @@ -77,7 +77,7 @@ bitstream_end(bitstream *bs) int bit_left = 32 - bit_offset; if (bit_offset) { -bs->buffer[pos] = swap32((bs->buffer[pos] << bit_left)); +bs->buffer[pos] = va_swap32((bs->buffer[pos] << bit_left)); } } @@ -101,7 +101,7 @@ bitstream_put_ui(bitstream *bs, unsigned int val, int } else { size_in_bits -= bit_left; bs->buffer[pos] = (bs->buffer[pos] << bit_left) | (val >> size_in_bits); -bs->buffer[pos] = swap32(bs->buffer[pos]); +bs->buffer[pos] = va_swap32(bs->buffer[pos]); if (pos + 1 == bs->max_size_in_dword) { bs->max_size_in_dword += BITSTREAM_ALLOCATE_STEPPING; diff -upr -x *.m4 -x Makefile.in libva-utils-2.6.0.orig/encode/mpeg2vaenc.c libva-utils-2.6.0/encode/mpeg2vaenc.c --- libva-utils-2.6.0.orig/encode/mpeg2vaenc.c Wed Dec 26 21:29:26 2018 +++ libva-utils-2.6.0/encode/mpeg2vaenc.c Fri Jan 24 14:05:48 2020 @@ -163,7 +163,7 @@ struct __bitstream { typedef struct __bitstream bitstream; static unsigned int -swap32(unsigned int val) +va_swap32(unsigned int val) { unsigned char *pval = (unsigned char *)&val; @@ -190,7 +190,7 @@ bitstream_end(bitstream *bs) int bit_left = 32 - bit_offset; if (bit_offset) { -bs->buffer[pos] = swap32((bs->buffer[pos] << bit_left)); +bs->buffer[pos] = va_swap32((bs->buffer[pos] << bit_left)); } } @@ -214,7 +214,7 @@ bitstream_put_ui(bitstream *bs, unsigned int val, int } else { size_in_bits -= bit_left; bs->buffer[pos] = (bs->buffer[pos] << bit_left) | (val >> size_in_bits); -bs->buffer[pos] = swap32(bs->buffer[pos]); +bs->buffer[pos] = va_swap32(bs->buffer[pos]); if (pos + 1 == bs->max_size_in_dword) { bs->max_size_in_dword += BITSTREAM_ALLOCATE_STEPPING; diff -upr -x *.m4 -x Makefile
Re: [Patch]: Integrate VA-API into xenocara
On Thu, Jan 23, 2020 at 12:39:29PM +1100, Jonathan Gray wrote: > On Wed, Dec 18, 2019 at 03:28:48PM -0600, Brad DeMorrow wrote: > > This is a rather large patch that moves my previously submitted > > VA-API ports into xenocara. For your convenience, I've inlined > > a diff that shows you all of the changes I made to existing files > > that you can easily read in your MUA. The attached patch also > > contains these changes and should be the only xenocara patch > > you need to apply. > > > > Summary of Changes: > > - libva added to xenocara/lib/libva > > - vainfo added to xenocara/app/vainfo > > - intel-vaapi-driver added to xenocara/driver/intel-vaapi-driver > > - Mesa Makefile.bsd-wrapper updated to build with --enable-va flag > > - 3RDPARTY file updated to include libva, libva-utils, and > > intel-vaapi-driver > > - BSD.x11.dist updated to include /usr/X11R6/include/va/ (separate patch) > > It is difficult to see where you have made changes, can you send patches > against source from particular tarballs? I built libva-2.6.1 but it does not work with non-intel drivers at runtime due to a Mesa bug: https://bugs.freedesktop.org/show_bug.cgi?id=109929 libva info: VA-API version 1.6.0 libva info: Trying to open /usr/X11R6/lib/dri/radeonsi_drv_video.so vainfo:/usr/X11R6/lib/dri/radeonsi_drv_video.so: undefined symbol 'gl_nir_lower_samplers_as_deref' vainfo:/usr/X11R6/lib/dri/radeonsi_drv_video.so: undefined symbol 'gl_nir_lower_samplers' libva error: dlopen of /usr/X11R6/lib/dri/radeonsi_drv_video.so failed: Cannot load specified object libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit Here is the diff for libva-2.6.1 from memory the horrible ifdef part came from FreeBSD via your port. --- /dev/null Fri Jan 24 16:36:40 2020 +++ libva-2.6.1/Makefile.bsd-wrapperFri Jan 24 13:56:21 2020 @@ -0,0 +1,5 @@ +# $OpenBSD$ + +SHARED_LIBS= va 0.0 va_drm 0.0 va_glx 0.0 va_x11 0.0 + +.include diff -upr -x *.m4 -x Makefile.in libva-2.6.1.orig/va/Makefile.am libva-2.6.1/va/Makefile.am --- libva-2.6.1.orig/va/Makefile.am Wed Dec 18 00:46:07 2019 +++ libva-2.6.1/va/Makefile.am Fri Jan 24 13:55:21 2020 @@ -91,7 +91,7 @@ libva_la_SOURCES = $(libva_source_c) libva_la_CFLAGS= $(libva_cflags) libva_la_LDFLAGS = $(libva_ldflags) libva_la_DEPENDENCIES = libva.syms -libva_la_LIBADD= $(LIBVA_LIBS) -ldl +libva_la_LIBADD= $(LIBVA_LIBS) $(DLOPEN_LIBS) if USE_DRM SUBDIRS+= drm @@ -101,7 +101,7 @@ libva_drm_la_CFLAGS = $(libva_cflags) libva_drm_la_LDFLAGS = $(LDADD) libva_drm_la_DEPENDENCIES = libva.la drm/libva_drm.la libva_drm_la_LIBADD= libva.la drm/libva_drm.la \ - $(LIBVA_LIBS) $(DRM_LIBS) -ldl + $(LIBVA_LIBS) $(DRM_LIBS) $(DLOPEN_LIBS) endif if USE_X11 @@ -113,7 +113,7 @@ libva_x11_la_CFLAGS = $(libva_cflags) libva_x11_la_LDFLAGS = $(LDADD) libva_x11_la_DEPENDENCIES = libva.la x11/libva_x11.la libva_x11_la_LIBADD= libva.la x11/libva_x11.la \ - $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(XFIXES_LIBS) $(DRM_LIBS) -ldl + $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(XFIXES_LIBS) $(DRM_LIBS) $(DLOPEN_LIBS) endif if USE_GLX @@ -124,7 +124,7 @@ libva_glx_la_CFLAGS = $(libva_cflags) libva_glx_la_LDFLAGS = $(LDADD) libva_glx_la_DEPENDENCIES = libva.la glx/libva_glx.la libva-x11.la libva_glx_la_LIBADD= libva.la glx/libva_glx.la libva-x11.la \ - $(GLX_LIBS) -ldl + $(GLX_LIBS) $(DLOPEN_LIBS) endif if USE_WAYLAND @@ -135,7 +135,7 @@ libva_wayland_la_CFLAGS = $(libva_cflags) libva_wayland_la_LDFLAGS = $(LDADD) libva_wayland_la_DEPENDENCIES = libva.la wayland/libva_wayland.la libva_wayland_la_LIBADD= libva.la wayland/libva_wayland.la \ - $(WAYLAND_LIBS) $(DRM_LIBS) -ldl + $(WAYLAND_LIBS) $(DRM_LIBS) $(DLOPEN_LIBS) endif DIST_SUBDIRS = x11 glx drm wayland Only in libva-2.6.1/va: Makefile.am.orig diff -upr -x *.m4 -x Makefile.in libva-2.6.1.orig/va/va.c libva-2.6.1/va/va.c --- libva-2.6.1.orig/va/va.cFri Jan 17 22:11:32 2020 +++ libva-2.6.1/va/va.c Fri Jan 24 13:55:21 2020 @@ -451,7 +451,7 @@ static VAStatus va_openDriver(VADisplay dpy, char *dri } va_infoMessage(dpy, "Trying to open %s\n", driver_path); -#ifndef ANDROID +#if defined(RTLD_NODELETE) handle = dlopen( driver_path, RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE ); #else handle = dlopen( driver_path, RTLD_NOW| RTLD_GLOBAL); Only in libva-2.6.1/va: va.c.orig diff -upr -x *.m4 -x Makefile.in libva-2.6.1.orig/va/va_trace.c libva-2.6.1/va/va_trace.c --- libva-2.6.1.orig/va/va_trace.c Wed Dec 18 00:46:07 2019 +++ libva-2.6.1/va/va_trace.c Fri Jan 24 13:55:21 2020 @@ -48,12 +48,42 @@ #include #include #include -#
Re: [Patch]: Integrate VA-API into xenocara
On Wed, Dec 18, 2019 at 03:28:48PM -0600, Brad DeMorrow wrote: > This is a rather large patch that moves my previously submitted > VA-API ports into xenocara. For your convenience, I've inlined > a diff that shows you all of the changes I made to existing files > that you can easily read in your MUA. The attached patch also > contains these changes and should be the only xenocara patch > you need to apply. > > Summary of Changes: > - libva added to xenocara/lib/libva > - vainfo added to xenocara/app/vainfo > - intel-vaapi-driver added to xenocara/driver/intel-vaapi-driver > - Mesa Makefile.bsd-wrapper updated to build with --enable-va flag > - 3RDPARTY file updated to include libva, libva-utils, and intel-vaapi-driver > - BSD.x11.dist updated to include /usr/X11R6/include/va/ (separate patch) It is difficult to see where you have made changes, can you send patches against source from particular tarballs?
Re: [Patch]: Integrate VA-API into xenocara
On Wed, Dec 18, 2019 at 03:28:48PM -0600, Brad DeMorrow wrote: > This is a rather large patch that moves my previously submitted > VA-API ports into xenocara. For your convenience, I've inlined > a diff that shows you all of the changes I made to existing files > that you can easily read in your MUA. The attached patch also > contains these changes and should be the only xenocara patch > you need to apply. > > Summary of Changes: > - libva added to xenocara/lib/libva > - vainfo added to xenocara/app/vainfo > - intel-vaapi-driver added to xenocara/driver/intel-vaapi-driver > - Mesa Makefile.bsd-wrapper updated to build with --enable-va flag > - 3RDPARTY file updated to include libva, libva-utils, and intel-vaapi-driver > - BSD.x11.dist updated to include /usr/X11R6/include/va/ (separate patch) > > Architectures Tested: amd64 > > Testing Instructions: > 1. save xenocara-vaapi.patch.gz to /tmp > 2. cd /tmp; gunzip xenocara-vaapi.patch.gz > 3. cd /usr/xenocara > 4. patch -p0 < /tmp/xenocara-vaapi.patch > 5. Follow normal build instructions in README within the root of xenocara > 6. Run vainfo. It should report available profiles and entrypoints for > VA-API. >Example of successful execution: Hi, I won't be able to look at this before the 28th, being busy for work and then away for vacation. Thaks for this work. -- Matthieu Herrb