summaryrefslogtreecommitdiff
path: root/x11-libs/intel-hybrid-codec-driver
diff options
context:
space:
mode:
Diffstat (limited to 'x11-libs/intel-hybrid-codec-driver')
-rw-r--r--x11-libs/intel-hybrid-codec-driver/Manifest8
-rw-r--r--x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-gcc10-fix.patch11
-rw-r--r--x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-invalid-read-fix.patch39
-rw-r--r--x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-nullptr-fix.patch21
-rw-r--r--x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-vadriverinit-fix.patch13
-rw-r--r--x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-x11-fix.patch54
-rw-r--r--x11-libs/intel-hybrid-codec-driver/intel-hybrid-codec-driver-2.0.0.ebuild53
-rw-r--r--x11-libs/intel-hybrid-codec-driver/metadata.xml18
8 files changed, 217 insertions, 0 deletions
diff --git a/x11-libs/intel-hybrid-codec-driver/Manifest b/x11-libs/intel-hybrid-codec-driver/Manifest
new file mode 100644
index 000000000000..d2ef44d28918
--- /dev/null
+++ b/x11-libs/intel-hybrid-codec-driver/Manifest
@@ -0,0 +1,8 @@
+AUX intel-hybrid-codec-driver-2.0.0-gcc10-fix.patch 460 BLAKE2B 94a225338835403788383b845ec4048608966170671944f73975dbee3e95ae49c943a32fbec0d59008f230186342fafb27af1f214664cd6f239f3d4eebb45a1c SHA512 bebaa765d3d97c5568fccfaa465fb13b717681b1846acce94dc7b45ba9ea48f017fce125f937b433e2eeec63985e3a555748277fedf8777ca0693acee78a4fed
+AUX intel-hybrid-codec-driver-2.0.0-invalid-read-fix.patch 1672 BLAKE2B 94e08496fd654fcb57d083ab72311ac29791ad488f2d55d92aba63b872a526563e015a3dfa48ebef957fed18372bf6e3be068e42bfa571c585d76bc1a42bfb01 SHA512 7efb4c30078b2c03f5ff15c48983d68971e95f0ae9eb637953b7ce972c21fb66ec04cbf30862ec2bc3200703d4d8994678022497c7a85a644404bf2f71095291
+AUX intel-hybrid-codec-driver-2.0.0-nullptr-fix.patch 907 BLAKE2B a894473043bf929d21bac2cfaacab5c3404dc82f1019c96909ab328be946c31034ba6cb5cd9ea60a234f3f0b44c6b48c49c49499f2c7cb7a34885237540dcbea SHA512 b450126fd487cee7b157ff08f01e83dbf8ed571f6938ff84e5c71fff174ff6b0826e7ce02b2604a58ce38baf7a6e0eb93cc430f719b02de1630bda499f4a8930
+AUX intel-hybrid-codec-driver-2.0.0-vadriverinit-fix.patch 447 BLAKE2B bcb9c088436c468732eb33991e2db50efe5bc51ab3ecbd1da814c71379ecf13980f53b327ed93022e0a83967fd1864ca08e707d0b22c0c1a41e4b63e9840c894 SHA512 440e909ad090d7fd5d07fcccbd288c9422c32df38704ec24f8ce513341229023a288638828b63f2174afd6460be79abc158b528a10f33fcb81f9f9cfcab4dbd8
+AUX intel-hybrid-codec-driver-2.0.0-x11-fix.patch 1915 BLAKE2B e203b5573494d7da4d1f17841a41c396012638f3bdea01796b821ea63f4fc4dadf9aebdd9c78cd2c613773528f8dcb719ff2f9c61dee2eca7e48896339579106 SHA512 bc9f985370a94e9dd1e41d9c091a5ed0a59c225094b8e16a4d669086aaef59b50e597ad4584d6a04f00a5095439896023fa5a2b901441d778cf2468f358a2b0a
+DIST intel-hybrid-codec-driver-2.0.0.tar.gz 1332637 BLAKE2B c02a54a12ad3b9d35bd4e15f9ffaecc8cd33750ab2eea73c8e4140ada1c666cd9a2b43725b44a22050f8140ffe2810ca87802854afb4c251cb879f219da8db6b SHA512 1d4e2c41d30892e07a3d2c83977725fca6fc20d887bead41109a0936fa9b4848131e4460cca8efe792f2815fcc9622d38d0a5e117a54403708e1132f1112d37a
+EBUILD intel-hybrid-codec-driver-2.0.0.ebuild 1229 BLAKE2B eb6d0f94a3797d239d9254b3cd6f48cfc8a4b3541232c390994c5533cc4d3dafa02f1d9a443709238f8b2b96a31e0a7b44a5b3708a9d2245177c4b77e147641e SHA512 d329b01f8d154a38bb8e9be381232e0f22a74c93a106bbef50463d2f28ba6018b1be1e7d1ff8b83086b70fcc3e8b6499549a42e018f2f49f4e697afca365d147
+MISC metadata.xml 593 BLAKE2B e6fcb9ac5b9b51f1c2b03f03a221b8333a190c7ba1b7ea36de4a1e4d61ef1e9593784ed6d500de87f618d286d3a921fa59f1a0482185677ce2bb961b3abdeac0 SHA512 ebe0afe41278366116f6e7a12039de8f09961fee1807370a63e0e459fceefbe6fca67a5fdfcb3f3892e457b8d211a6b48b48d6f335e197b61a86d2f33ac03779
diff --git a/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-gcc10-fix.patch b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-gcc10-fix.patch
new file mode 100644
index 000000000000..0c170579857f
--- /dev/null
+++ b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-gcc10-fix.patch
@@ -0,0 +1,11 @@
+--- intel-hybrid-driver/src/media_drv_common.h 2020-05-26 23:18:02.279795861 +0100
++++ intel-hybrid-driver-new/src/media_drv_common.h 2020-05-26 23:19:11.316101524 +0100
+@@ -39,6 +39,6 @@
+ #define BRC_INIT_IGNORE_PICTURE_HEADER_SIZE 0x2000
+ #define BRC_INIT_DISABLE_MBBRC 0x8000
+
+-UINT SEARCH_PATH_TABLE[2][8][16];
+-UINT ME_CURBE_INIT_DATA[30];
++extern UINT SEARCH_PATH_TABLE[2][8][16];
++extern UINT ME_CURBE_INIT_DATA[30];
+ #endif
diff --git a/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-invalid-read-fix.patch b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-invalid-read-fix.patch
new file mode 100644
index 000000000000..e410a8cc89c5
--- /dev/null
+++ b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-invalid-read-fix.patch
@@ -0,0 +1,39 @@
+diff --git a/src/media_drv_gen75_render.c b/src/media_drv_gen75_render.c
+index a3d60ff..51b1442 100644
+--- a/src/media_drv_gen75_render.c
++++ b/src/media_drv_gen75_render.c
+@@ -1453,7 +1453,7 @@ media_drv_gen75_render_init(VADriverContextP ctx)
+
+ if (IS_HASWELL (drv_ctx->drv_data.device_id)) {
+ memcpy(render_state->render_kernels, render_kernels_gen7_haswell,
+- sizeof(render_state->render_kernels));
++ sizeof(render_kernels_gen7_haswell));
+ render_state->render_put_surface = gen7_render_put_surface;
+ render_state->render_put_subpicture = gen7_render_put_subpicture;
+ } else {
+diff --git a/src/media_drv_gen8_render.c b/src/media_drv_gen8_render.c
+index 42005ea..da349cc 100644
+--- a/src/media_drv_gen8_render.c
++++ b/src/media_drv_gen8_render.c
+@@ -1741,7 +1741,7 @@ media_drv_gen8_render_init(VADriverContextP ctx)
+ render_state->max_wm_threads = 64;
+
+ memcpy(render_state->render_kernels, render_kernels_gen8,
+- sizeof(render_state->render_kernels));
++ sizeof(render_kernels_gen8));
+
+ kernel_size = 4096;
+
+diff --git a/src/media_drv_hw_g75.c b/src/media_drv_hw_g75.c
+index 57eddbd..080cd86 100644
+--- a/src/media_drv_hw_g75.c
++++ b/src/media_drv_hw_g75.c
+@@ -3325,7 +3325,7 @@ media_set_curbe_vp8_me (VP8_ME_CURBE_PARAMS * params)
+ MEDIA_CURBE_DATA_ME *cmd = (MEDIA_CURBE_DATA_ME *) params->curbe_cmd_buff;
+
+ media_drv_memcpy (cmd, sizeof (MEDIA_CURBE_DATA_ME), ME_CURBE_INIT_DATA,
+- sizeof (MEDIA_CURBE_DATA_ME));
++ sizeof (ME_CURBE_INIT_DATA));
+ me_mode =
+ params->
+ me_16x_enabled ? (params->me_16x ? ME16x_BEFORE_ME4x : ME4x_AFTER_ME16x) :
diff --git a/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-nullptr-fix.patch b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-nullptr-fix.patch
new file mode 100644
index 000000000000..84562584b6a2
--- /dev/null
+++ b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-nullptr-fix.patch
@@ -0,0 +1,21 @@
+diff --git a/src/vp9hdec/decode_hybrid_vp9.cpp b/src/vp9hdec/decode_hybrid_vp9.cpp
+index 1baf339..7a086e2 100644
+--- a/src/vp9hdec/decode_hybrid_vp9.cpp
++++ b/src/vp9hdec/decode_hybrid_vp9.cpp
+@@ -3289,9 +3289,16 @@ VAStatus Intel_HybridVp9Decode_HostVldRenderCb (
+
+ // Reset padding flag of current frame and update surface dimension
+ surface = SURFACE(pMdfDecodeFrame->ucCurrIndex);
++ if ((surface == NULL) || (surface->private_data == NULL))
++ return VA_STATUS_ERROR_INVALID_PARAMETER;
++
+ pFrameSource = (INTEL_DECODE_HYBRID_VP9_MDF_FRAME_SOURCE *)(surface->private_data);
+ pCurrFrame = &(pFrameSource->Frame);
+ pFrameSource->bHasPadding = false;
++
++ if (pCurrFrame->pMdfSurface == NULL)
++ return VA_STATUS_ERROR_INVALID_PARAMETER;
++
+ pCurrFrame->pMdfSurface->SetSurfaceStateDimensions(
+ pMdfDecodeFrame->dwWidth,
+ pMdfDecodeFrame->dwHeight);
diff --git a/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-vadriverinit-fix.patch b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-vadriverinit-fix.patch
new file mode 100644
index 000000000000..5177e1448539
--- /dev/null
+++ b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-vadriverinit-fix.patch
@@ -0,0 +1,13 @@
+--- intel-hybrid-driver/src/media_drv_init.c
++++ intel-hybrid-driver-new/src/media_drv_init.c
+@@ -2764,9 +2764,9 @@ va_driver_init (VADriverContextP ctx)
+ return ret;
+ }
+
+-VAStatus DLL_EXPORT __vaDriverInit_0_34 (VADriverContextP ctx);
++VAStatus DLL_EXPORT VA_DRIVER_INIT_FUNC (VADriverContextP ctx);
+ VAStatus
+-__vaDriverInit_0_34 (VADriverContextP ctx)
++VA_DRIVER_INIT_FUNC (VADriverContextP ctx)
+ {
+ VAStatus ret = VA_STATUS_ERROR_UNKNOWN;
diff --git a/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-x11-fix.patch b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-x11-fix.patch
new file mode 100644
index 000000000000..2422e4d1721b
--- /dev/null
+++ b/x11-libs/intel-hybrid-codec-driver/files/intel-hybrid-codec-driver-2.0.0-x11-fix.patch
@@ -0,0 +1,54 @@
+From b3b4d9a3a08d48bf6022723908a22255cc271ab7 Mon Sep 17 00:00:00 2001
+From: Daniel Charles <daniel.charles@intel.com>
+Date: Fri, 4 May 2018 09:56:10 -0700
+Subject: [PATCH] driver_init: load libva-x11.so for any ABI version
+
+with libva > 2.0.0 hybrid driver can operate with it as well
+so make this load generic to libva installed version
+
+Signed-off-by: Daniel Charles <daniel.charles@intel.com>
+---
+ src/media_drv_output_dri.c | 10 ++++++++++
+ src/media_drv_output_dri.h | 2 +-
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/src/media_drv_output_dri.c b/src/media_drv_output_dri.c
+index 42299b8..bbd9713 100644
+--- a/src/media_drv_output_dri.c
++++ b/src/media_drv_output_dri.c
+@@ -105,6 +105,15 @@ media_output_dri_init (VADriverContextP ctx)
+ struct dri_vtable *dri_vtable;
+
+ static const struct dso_symbol symbols[] = {
++#if VA_CHECK_VERSION(1,0,0)
++ {"va_dri_get_drawable",
++ offsetof (struct dri_vtable, get_drawable)},
++ {"va_dri_get_rendering_buffer",
++ offsetof (struct dri_vtable, get_rendering_buffer)},
++ {"va_dri_swap_buffer",
++ offsetof (struct dri_vtable, swap_buffer)},
++ {NULL,}
++#else
+ {"dri_get_drawable",
+ offsetof (struct dri_vtable, get_drawable)},
+ {"dri_get_rendering_buffer",
+@@ -112,6 +121,7 @@ media_output_dri_init (VADriverContextP ctx)
+ {"dri_swap_buffer",
+ offsetof (struct dri_vtable, swap_buffer)},
+ {NULL,}
++#endif
+ };
+
+ drv_ctx->dri_output =
+diff --git a/src/media_drv_output_dri.h b/src/media_drv_output_dri.h
+index 0d6ccf0..889861c 100644
+--- a/src/media_drv_output_dri.h
++++ b/src/media_drv_output_dri.h
+@@ -30,7 +30,7 @@
+ #define _MEDIA__DRIVER_OUT_DRI_H
+ #include <stdbool.h>
+ #include "media_drv_defines.h"
+-#define LIBVA_X11_NAME "libva-x11.so.1"
++#define LIBVA_X11_NAME "libva-x11.so.2"
+ VOID media_output_dri_terminate (VADriverContextP ctx);
+ BOOL media_output_dri_init (VADriverContextP ctx);
diff --git a/x11-libs/intel-hybrid-codec-driver/intel-hybrid-codec-driver-2.0.0.ebuild b/x11-libs/intel-hybrid-codec-driver/intel-hybrid-codec-driver-2.0.0.ebuild
new file mode 100644
index 000000000000..860feeb69f61
--- /dev/null
+++ b/x11-libs/intel-hybrid-codec-driver/intel-hybrid-codec-driver-2.0.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_64 )
+EGIT_COMMIT="edead0c17e2818bc0fee0ea644f85ab81bbe6f7a"
+
+inherit autotools multilib-minimal
+
+DESCRIPTION="Libva support for partially hardware accelerated encode and decode on Haswell and newer"
+HOMEPAGE="https://github.com/intel/intel-hybrid-driver"
+SRC_URI="https://github.com/intel/intel-hybrid-driver/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/intel-hybrid-driver-${EGIT_COMMIT}"
+
+KEYWORDS="~amd64 ~amd64-linux"
+LICENSE="MIT"
+SLOT="0"
+IUSE="wayland X"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+ >=x11-libs/cmrt-1.0.6
+ >=x11-libs/libdrm-2.4.45
+ >=x11-libs/libva-1.0.16[${MULTILIB_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-gcc10-fix.patch"
+ "${FILESDIR}/${P}-vadriverinit-fix.patch"
+ "${FILESDIR}/${P}-x11-fix.patch"
+ "${FILESDIR}/${P}-nullptr-fix.patch"
+ "${FILESDIR}/${P}-invalid-read-fix.patch"
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ local myconf=(
+ $(use_enable wayland)
+ $(use_enable X x11)
+ )
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+ default
+ find "${D}" -name "*.la" -delete || die
+}
diff --git a/x11-libs/intel-hybrid-codec-driver/metadata.xml b/x11-libs/intel-hybrid-codec-driver/metadata.xml
new file mode 100644
index 000000000000..b93334ee2543
--- /dev/null
+++ b/x11-libs/intel-hybrid-codec-driver/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>media-video@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person" proxied="yes">
+ <email>kaichun.ning@gmail.com</email>
+ <name>Kai-Chun Ning</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">intel/intel-hybrid-driver</remote-id>
+ </upstream>
+</pkgmetadata>