diff --git a/x11/driver/libva-vdpau-driver/actions.py b/x11/driver/libva-vdpau-driver/actions.py new file mode 100644 index 0000000000..6e01be5fa1 --- /dev/null +++ b/x11/driver/libva-vdpau-driver/actions.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/copyleft/gpl.txt. + +from pisi.actionsapi import get +from pisi.actionsapi import autotools +from pisi.actionsapi import pisitools + +def setup(): + autotools.autoreconf("-vif") + autotools.configure() + +def build(): + autotools.make() + +def install(): + autotools.rawInstall("DESTDIR=%s" % get.installDIR()) + + pisitools.dodoc("COPYING", "AUTHORS", "README") diff --git a/x11/driver/libva-vdpau-driver/files/fallback-x.patch b/x11/driver/libva-vdpau-driver/files/fallback-x.patch new file mode 100644 index 0000000000..8e44098782 --- /dev/null +++ b/x11/driver/libva-vdpau-driver/files/fallback-x.patch @@ -0,0 +1,51 @@ +Index: vdpau-video-0.7.4/src/vdpau_driver.c +=================================================================== +--- vdpau-video-0.7.4.orig/src/vdpau_driver.c ++++ vdpau-video-0.7.4/src/vdpau_driver.c +@@ -174,7 +174,7 @@ vdpau_common_Terminate(vdpau_driver_data + } + vdpau_gate_exit(driver_data); + +- if (driver_data->vdp_dpy) { ++ if (!driver_data->x_fallback && driver_data->vdp_dpy) { + XCloseDisplay(driver_data->vdp_dpy); + driver_data->vdp_dpy = NULL; + } +@@ -187,9 +187,14 @@ vdpau_common_Initialize(vdpau_driver_dat + /* Create a dedicated X11 display for VDPAU purposes */ + const char * const x11_dpy_name = XDisplayString(driver_data->x11_dpy); + driver_data->vdp_dpy = XOpenDisplay(x11_dpy_name); +- if (!driver_data->vdp_dpy) +- return VA_STATUS_ERROR_UNKNOWN; +- ++ /* Fallback to existing X11 display */ ++ driver_data->x_fallback = false; ++ if (!driver_data->vdp_dpy) { ++ driver_data->x_fallback = true; ++ driver_data->vdp_dpy = driver_data->x11_dpy; ++ printf("Failed to create dedicated X11 display!\n"); ++ } ++ + VdpStatus vdp_status; + driver_data->vdp_device = VDP_INVALID_HANDLE; + vdp_status = vdp_device_create_x11( +Index: vdpau-video-0.7.4/src/vdpau_driver.h +=================================================================== +--- vdpau-video-0.7.4.orig/src/vdpau_driver.h ++++ vdpau-video-0.7.4/src/vdpau_driver.h +@@ -21,6 +21,7 @@ + #ifndef VDPAU_DRIVER_H + #define VDPAU_DRIVER_H + ++#include + #include + #include "vaapi_compat.h" + #include "vdpau_gate.h" +@@ -100,6 +101,7 @@ struct vdpau_driver_data { + uint64_t va_display_attrs_mtime[VDPAU_MAX_DISPLAY_ATTRIBUTES]; + unsigned int va_display_attrs_count; + char va_vendor[256]; ++ bool x_fallback; + }; + + typedef struct object_config *object_config_p; diff --git a/x11/driver/libva-vdpau-driver/files/implement-vaquerysurfaceattributes.patch b/x11/driver/libva-vdpau-driver/files/implement-vaquerysurfaceattributes.patch new file mode 100644 index 0000000000..d3267495cf --- /dev/null +++ b/x11/driver/libva-vdpau-driver/files/implement-vaquerysurfaceattributes.patch @@ -0,0 +1,105 @@ +Index: vdpau-video-0.7.4/src/vdpau_driver_template.h +=================================================================== +--- vdpau-video-0.7.4.orig/src/vdpau_driver_template.h ++++ vdpau-video-0.7.4/src/vdpau_driver_template.h +@@ -115,6 +115,13 @@ struct VA_DRIVER_VTABLE { + int *num_attribs /* out */ + ); + ++ VAStatus (*vaQuerySurfaceAttributes) ( ++ VADisplay dpy, ++ VAConfigID config_id, ++ VASurfaceAttrib *attrib_list, /* out */ ++ unsigned int *num_attribs /* out */ ++ ); ++ + VAStatus (*vaCreateSurfaces) ( + VADriverContextP ctx, + int width, +@@ -589,6 +596,7 @@ static VAStatus FUNC(Initialize)(VA_DRIV + vtable->vaCreateConfig = vdpau_CreateConfig; + vtable->vaDestroyConfig = vdpau_DestroyConfig; + vtable->vaGetConfigAttributes = vdpau_GetConfigAttributes; ++ vtable->vaQuerySurfaceAttributes = vdpau_QuerySurfaceAttributes; + vtable->vaCreateSurfaces = vdpau_CreateSurfaces; + vtable->vaDestroySurfaces = vdpau_DestroySurfaces; + vtable->vaCreateContext = vdpau_CreateContext; +Index: vdpau-video-0.7.4/src/vdpau_video.c +=================================================================== +--- vdpau-video-0.7.4.orig/src/vdpau_video.c ++++ vdpau-video-0.7.4/src/vdpau_video.c +@@ -309,6 +309,54 @@ int surface_remove_association( + return -1; + } + ++// vaQuerySurfaceAttributes ++VAStatus ++vdpau_QuerySurfaceAttributes( ++ VADriverContextP ctx, ++ VAConfigID config_id, ++ VASurfaceAttrib *attrib_list, ++ unsigned int *num_attribs ++) ++{ ++ VDPAU_DRIVER_DATA_INIT; ++ ++ object_config_p obj_config; ++ if ((obj_config = VDPAU_CONFIG(config_id)) == NULL) ++ return VA_STATUS_ERROR_INVALID_CONFIG; ++ ++ if (!attrib_list && !num_attribs) ++ return VA_STATUS_ERROR_INVALID_PARAMETER; ++ ++ if (!attrib_list) { ++ *num_attribs = 2; ++ return VA_STATUS_SUCCESS; ++ } ++ ++ if (*num_attribs < 2) { ++ *num_attribs = 2; ++ return VA_STATUS_ERROR_MAX_NUM_EXCEEDED; ++ } ++ ++ VdpDecoderProfile vdp_profile; ++ uint32_t max_width, max_height; ++ vdp_profile = get_VdpDecoderProfile(obj_config->profile); ++ if (!get_max_surface_size(driver_data, vdp_profile, &max_width, &max_height)) ++ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE; ++ ++ if (attrib_list) { ++ attrib_list[0].type = VASurfaceAttribMaxWidth; ++ attrib_list[0].flags = VA_SURFACE_ATTRIB_GETTABLE; ++ attrib_list[0].value.type = VAGenericValueTypeInteger; ++ attrib_list[0].value.value.i = max_width; ++ attrib_list[1].type = VASurfaceAttribMaxHeight; ++ attrib_list[1].flags = VA_SURFACE_ATTRIB_GETTABLE; ++ attrib_list[1].value.type = VAGenericValueTypeInteger; ++ attrib_list[1].value.value.i = max_height; ++ } ++ ++ return VA_STATUS_SUCCESS; ++} ++ + // vaDestroySurfaces + VAStatus + vdpau_DestroySurfaces( +Index: vdpau-video-0.7.4/src/vdpau_video.h +=================================================================== +--- vdpau-video-0.7.4.orig/src/vdpau_video.h ++++ vdpau-video-0.7.4/src/vdpau_video.h +@@ -165,6 +165,15 @@ vdpau_QueryConfigAttributes( + int *num_attribs + ) attribute_hidden; + ++// vaQuerySurfaceAttributes ++VAStatus ++vdpau_QuerySurfaceAttributes( ++ VADriverContextP ctx, ++ VAConfigID config_id, ++ VASurfaceAttrib *attrib_list, ++ unsigned int *num_attribs ++) attribute_hidden; ++ + // vaCreateSurfaces + VAStatus + vdpau_CreateSurfaces( diff --git a/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-VAEncH264VUIBufferType.patch b/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-VAEncH264VUIBufferType.patch new file mode 100644 index 0000000000..74caee3483 --- /dev/null +++ b/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-VAEncH264VUIBufferType.patch @@ -0,0 +1,29 @@ +>From fda3706eb74ba5ad874853969f3df3e372739c8d Mon Sep 17 00:00:00 2001 +From: "Xiang, Haihao" +Date: Fri, 21 Jun 2013 12:55:30 +0800 +Subject: [PATCH] VAEncH264VUIBufferType and VAEncH264SEIBufferType are + dropped from VA API + +The driver doesn't use them indeed + +Signed-off-by: Xiang, Haihao +--- + src/vdpau_dump.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/vdpau_dump.c b/src/vdpau_dump.c +index 899888b..610e7cd 100644 +--- a/src/vdpau_dump.c ++++ b/src/vdpau_dump.c +@@ -59,8 +59,6 @@ const char *string_of_VABufferType(VABufferType type) + _(VAEncSequenceParameterBufferType); + _(VAEncPictureParameterBufferType); + _(VAEncSliceParameterBufferType); +- _(VAEncH264VUIBufferType); +- _(VAEncH264SEIBufferType); + #endif + #if VA_CHECK_VERSION(0,31,1) + _(VAQMatrixBufferType); +-- +1.7.9.5 + diff --git a/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-glext-missing-definition.patch b/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-glext-missing-definition.patch new file mode 100644 index 0000000000..b56d268343 --- /dev/null +++ b/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-glext-missing-definition.patch @@ -0,0 +1,16 @@ +--- a/src/utils_glx.h~ 2012-10-05 16:02:58.000000000 +0100 ++++ b/src/utils_glx.h 2012-10-19 08:44:12.469642440 +0100 +@@ -48,6 +48,13 @@ + typedef void (*PFNGLXRELEASETEXIMAGEEXTPROC)(Display *, GLXDrawable, int); + #endif + ++#if GL_GLEXT_VERSION >= 85 ++/* XXX: PFNGLMULTITEXCOORD2FPROC got out of the GL_VERSION_1_3_DEPRECATED ++ block and is not defined if GL_VERSION_1_3 is defined in ++ Redefine the type here as an interim solution */ ++typedef void (*PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); ++#endif ++ + #ifndef GL_FRAMEBUFFER_BINDING + #define GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_EXT + #endif diff --git a/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-libvdpau-0.8.patch b/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-libvdpau-0.8.patch new file mode 100644 index 0000000000..ab3a479986 --- /dev/null +++ b/x11/driver/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-libvdpau-0.8.patch @@ -0,0 +1,11 @@ +--- a/src/vdpau_decode.c ++++ b/src/vdpau_decode.c +@@ -1289,7 +1289,7 @@ + driver_data, + obj_context->vdp_decoder, + obj_surface->vdp_surface, +- (VdpPictureInfo)&obj_context->vdp_picture_info, ++ (VdpPictureInfo *)&obj_context->vdp_picture_info, + obj_context->vdp_bitstream_buffers_count, + obj_context->vdp_bitstream_buffers + ); diff --git a/x11/driver/libva-vdpau-driver/files/vdpau_CreateSurfaceFromV4L2Buf-fix.patch b/x11/driver/libva-vdpau-driver/files/vdpau_CreateSurfaceFromV4L2Buf-fix.patch new file mode 100644 index 0000000000..f208c55379 --- /dev/null +++ b/x11/driver/libva-vdpau-driver/files/vdpau_CreateSurfaceFromV4L2Buf-fix.patch @@ -0,0 +1,28 @@ +diff -Nru libva-vdpau-driver-0.7.4.orig/src/vdpau_video.c libva-vdpau-driver-0.7.4/src/vdpau_video.c +--- libva-vdpau-driver-0.7.4.orig/src/vdpau_video.c 2012-10-05 18:02:58.000000000 +0300 ++++ libva-vdpau-driver-0.7.4/src/vdpau_video.c 2020-01-14 14:52:16.835039658 +0300 +@@ -927,8 +927,10 @@ + vdpau_CreateSurfaceFromV4L2Buf( + VADriverContextP ctx, + int v4l2_fd, ++ /* + struct v4l2_format *v4l2_fmt, + struct v4l2_buffer *v4l2_buf, ++ */ + VASurfaceID *surface + ) + { +diff -Nru libva-vdpau-driver-0.7.4.orig/src/vdpau_video.h libva-vdpau-driver-0.7.4/src/vdpau_video.h +--- libva-vdpau-driver-0.7.4.orig/src/vdpau_video.h 2012-10-05 18:02:58.000000000 +0300 ++++ libva-vdpau-driver-0.7.4/src/vdpau_video.h 2020-01-14 14:52:33.336040027 +0300 +@@ -274,8 +274,10 @@ + vdpau_CreateSurfaceFromV4L2Buf( + VADriverContextP ctx, + int v4l2_fd, ++ /* + struct v4l2_format *v4l2_fmt, + struct v4l2_buffer *v4l2_buf, ++ */ + VASurfaceID *surface + ) attribute_hidden; + diff --git a/x11/driver/libva-vdpau-driver/pspec.xml b/x11/driver/libva-vdpau-driver/pspec.xml new file mode 100644 index 0000000000..cf955347b2 --- /dev/null +++ b/x11/driver/libva-vdpau-driver/pspec.xml @@ -0,0 +1,81 @@ + + + + + libva-vdpau-driver + https://github.com/arekinath/libva-vdpau-driver + + İdris Kalp + idriskalp@gmail.com + + GPL + driver + VDPAU backend for VA API + libva-vdpau-driver consists in a VDPAU-based backend for VA-API + https://freedesktop.org/software/vaapi/releases/libva-vdpau-driver/libva-vdpau-driver-0.7.4.tar.bz2 + + + libva-devel + libvdpau-devel + libX11-devel + mesa-devel + + + libva-vdpau-driver-0.7.4-glext-missing-definition.patch + libva-vdpau-driver-0.7.4-libvdpau-0.8.patch + libva-vdpau-driver-0.7.4-VAEncH264VUIBufferType.patch + implement-vaquerysurfaceattributes.patch + fallback-x.patch + vdpau_CreateSurfaceFromV4L2Buf-fix.patch + + + + + libva-vdpau-driver + + + libva + libvdpau + libX11 + mesa + + + /usr/lib + /usr/share/doc + + + + + libva-vdpau-driver-32bit + emul32 + emul32 + + + libva-32bit + libvdpau-32bit + libX11-32bit + mesa-32bit + + + libva-vdpau-driver + + libva-32bit + libvdpau-32bit + libX11-32bit + mesa-32bit + + + /usr/lib32 + + + + + + 2020-01-14 + 0.7.4 + First release + İdris Kalp + idriskalp@gmail.com + + +