From b64fcbba211a80b5e4e9d120c882fed372a5950c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 27 2022 09:22:15 +0000 Subject: import libva-2.13.0-2.el8 --- diff --git a/.gitignore b/.gitignore index a196b0a..51f3937 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libva-2.5.0.tar.gz +SOURCES/libva-2.13.0.tar.gz diff --git a/.libva.metadata b/.libva.metadata index 123f3e7..e55ec51 100644 --- a/.libva.metadata +++ b/.libva.metadata @@ -1 +1 @@ -fd8568aaa9dd6e7f9721ac335fc87ad3c6f0d34b SOURCES/libva-2.5.0.tar.gz +519444a1c96d8f485d8e56d4445eb53168c9c4e1 SOURCES/libva-2.13.0.tar.gz diff --git a/SOURCES/libva-2.13.0-covscan.patch b/SOURCES/libva-2.13.0-covscan.patch new file mode 100644 index 0000000..3e645c0 --- /dev/null +++ b/SOURCES/libva-2.13.0-covscan.patch @@ -0,0 +1,46 @@ +diff --git a/va/va.c b/va/va.c +index 115f785..62d39b4 100644 +--- a/va/va.c ++++ b/va/va.c +@@ -733,8 +733,10 @@ VAStatus vaInitialize( + } + /*load driver one by one, until load success */ + for (candidate_index = 0; candidate_index < num_candidates; candidate_index ++) { +- if (driver_name) ++ if (driver_name) { + free(driver_name); ++ driver_name = NULL; ++ } + vaStatus = va_getDriverNameByIndex(dpy, &driver_name, candidate_index); + if (vaStatus != VA_STATUS_SUCCESS) { + va_errorMessage(dpy, "vaGetDriverNameByIndex() failed with %s, driver_name = %s\n", vaErrorStr(vaStatus), driver_name); +diff --git a/va/va_trace.c b/va/va_trace.c +index b291ade..4efdf1a 100644 +--- a/va/va_trace.c ++++ b/va/va_trace.c +@@ -40,6 +40,7 @@ + #include "va_str.h" + #include "va_vpp.h" + #include ++#include + #include + #include + #include +@@ -5824,7 +5825,7 @@ void va_TraceSyncSurface2( + TRACE_FUNCNAME(idx); + + va_TraceMsg(trace_ctx, "\tsurface = 0x%08x\n", surface); +- va_TraceMsg(trace_ctx, "\ttimeout_ns = %d\n", timeout_ns); ++ va_TraceMsg(trace_ctx, "\ttimeout_ns = %" PRIu64 "\n", timeout_ns); + va_TraceMsg(trace_ctx, NULL); + + DPY2TRACE_VIRCTX_EXIT(pva_trace); +@@ -5905,7 +5906,7 @@ void va_TraceSyncBuffer( + TRACE_FUNCNAME(idx); + + va_TraceMsg(trace_ctx, "\tbuf_id = 0x%08x\n", buf_id); +- va_TraceMsg(trace_ctx, "\ttimeout_ns = %d\n", timeout_ns); ++ va_TraceMsg(trace_ctx, "\ttimeout_ns = %" PRIu64 "\n", timeout_ns); + va_TraceMsg(trace_ctx, NULL); + + DPY2TRACE_VIRCTX_EXIT(pva_trace); diff --git a/SOURCES/libva-2.13.0-crocus.patch b/SOURCES/libva-2.13.0-crocus.patch new file mode 100644 index 0000000..b86d40e --- /dev/null +++ b/SOURCES/libva-2.13.0-crocus.patch @@ -0,0 +1,22 @@ +From 906d70e8e04a8a7f5062053a1f01fb318deb6910 Mon Sep 17 00:00:00 2001 +From: Jan Beich +Date: Sun, 31 Oct 2021 07:32:18 +0000 +Subject: [PATCH] VA/X11: VAAPI driver mapping for crocus DRI driver + +crocus supports Gen4 to Gen7.5, so only i965 can be used. +--- + va/x11/va_x11.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c +index 4d06acd2..9687afaf 100644 +--- a/va/x11/va_x11.c ++++ b/va/x11/va_x11.c +@@ -55,6 +55,7 @@ static const struct driver_name_map g_dri2_driver_name_map[] = { + { "i965", 4, "i965" }, // Intel i965 VAAPI driver with i965 DRI driver + { "iris", 4, "iHD" }, // Intel iHD VAAPI driver with iris DRI driver + { "iris", 4, "i965" }, // Intel i965 VAAPI driver with iris DRI driver ++ { "crocus", 6, "i965" }, // Intel i965 VAAPI driver with crocus DRI driver + { NULL, 0, NULL } + }; + diff --git a/SOURCES/libva-2.13.0-strong-sp.patch b/SOURCES/libva-2.13.0-strong-sp.patch new file mode 100644 index 0000000..672ead6 --- /dev/null +++ b/SOURCES/libva-2.13.0-strong-sp.patch @@ -0,0 +1,88 @@ +From 3f43acf73403a8241fb0f35cdf645a473affa28d Mon Sep 17 00:00:00 2001 +From: Jiri Kucera +Date: Wed, 6 Apr 2022 12:39:16 +0200 +Subject: [PATCH] Use also strong stack protection if supported + +The current solution appends -fstack-protector to CFLAGS which may +override -fstack-protector-strong set by user. The proposed change +prefers -fstack-protector-strong over -fstack-protector if it is +supported and specified by the user in CFLAGS. +--- + configure.ac | 41 +++++++++++++++++++++++++++++++++-------- + va/Makefile.am | 4 +--- + 2 files changed, 34 insertions(+), 11 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 37485154..6d6acd14 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -214,21 +214,46 @@ AC_SEARCH_LIBS([dlopen], [dl], [], [ + AC_MSG_ERROR([unable to find the dlopen() function]) + ]) + +-# Check for -fstack-protector +-ssp_cc=yes ++# Check for -fstack-protector and -fstack-protector-strong ++SSP_CC_FLAG="" + if test "X$CC-cc" != "X"; then +- AC_MSG_CHECKING([whether ${CC-cc} accepts -fstack-protector]) ++ # Do not duplicate options in CFLAGS ++ ssp_sp_set=no ++ ssp_sps_set=no ++ for ssp_x in $CFLAGS; do ++ case "X$ssp_x" in ++ X-fstack-protector) ssp_sp_set=yes ;; ++ X-fstack-protector-strong) ssp_sps_set=yes ;; ++ esac ++ done + ssp_old_cflags="$CFLAGS" +- CFLAGS="$CFLAGS -fstack-protector" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[alloca(100);]])], [], [ssp_cc=no]) ++ # Prefer -fstack-protector-strong over -fstack-protector ++ if test "X$ssp_sps_set" = "Xno"; then ++ SSP_CC_FLAG="-fstack-protector-strong" ++ fi ++ AC_MSG_CHECKING([whether ${CC-cc} accepts -fstack-protector-strong]) ++ CFLAGS="$ssp_old_cflags $SSP_CC_FLAG" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[alloca(100);]])], [ssp_cc=yes], [ssp_cc=no]) + AC_MSG_RESULT([$ssp_cc]) + if test "X$ssp_cc" = "Xno"; then +- CFLAGS="$ssp_old_cflags" +- else ++ # Fallback to -fstack-protector ++ if test "X$ssp_sp_set" = "Xno"; then ++ SSP_CC_FLAG="-fstack-protector" ++ fi ++ AC_MSG_CHECKING([whether ${CC-cc} accepts -fstack-protector]) ++ CFLAGS="$ssp_old_cflags $SSP_CC_FLAG" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[alloca(100);]])], [ssp_cc=yes], [ssp_cc=no]) ++ AC_MSG_RESULT([$ssp_cc]) ++ if test "X$ssp_cc" = "Xno"; then ++ SSP_CC_FLAG="" ++ fi ++ fi ++ CFLAGS="$ssp_old_cflags $SSP_CC_FLAG" ++ if test "X$ssp_cc" = "Xyes"; then + AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.]) + fi + fi +-AM_CONDITIONAL(USE_SSP, test "$ssp_cc" = "yes") ++AC_SUBST(SSP_CC_FLAG) + + # Check for DRM (mandatory) + LIBDRM_VERSION=libdrm_version +diff --git a/va/Makefile.am b/va/Makefile.am +index f3e61afa..3c4ba272 100644 +--- a/va/Makefile.am ++++ b/va/Makefile.am +@@ -82,9 +82,7 @@ libva_cflags = \ + -Wall \ + $(NULL) + +-if USE_SSP +-libva_cflags += -fstack-protector +-endif ++libva_cflags += $(SSP_CC_FLAG) + + lib_LTLIBRARIES = libva.la + libvaincludedir = ${includedir}/va diff --git a/SOURCES/libva-2.5.0-covscan.patch b/SOURCES/libva-2.5.0-covscan.patch deleted file mode 100644 index 0313293..0000000 --- a/SOURCES/libva-2.5.0-covscan.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff --git a/va/glx/va_glx_impl.c b/va/glx/va_glx_impl.c -index 23ea270..fa44da2 100644 ---- a/va/glx/va_glx_impl.c -+++ b/va/glx/va_glx_impl.c -@@ -939,7 +939,7 @@ static VAStatus - vaDestroySurfaceGLX_impl_libva(VADriverContextP ctx, void *gl_surface) - { - VASurfaceGLXP pSurfaceGLX; -- struct OpenGLContextState old_cs, *new_cs; -+ struct OpenGLContextState old_cs = {0}, *new_cs; - - INIT_SURFACE(pSurfaceGLX, gl_surface); - -@@ -1072,7 +1072,7 @@ vaCopySurfaceGLX_impl_libva( - { - VASurfaceGLXP pSurfaceGLX; - VAStatus status; -- struct OpenGLContextState old_cs; -+ struct OpenGLContextState old_cs = {0}; - - INIT_SURFACE(pSurfaceGLX, gl_surface); - -diff --git a/va/va_trace.c b/va/va_trace.c -index d34fc40..7cd5ae5 100755 ---- a/va/va_trace.c -+++ b/va/va_trace.c -@@ -996,7 +996,7 @@ static void va_TraceSurface(VADisplay dpy, VAContextID context) - vaUnlockSurface(dpy, trace_ctx->trace_rendertarget); - return; - } -- va_TraceMsg(trace_ctx, "\tbuffer location = 0x%08x\n", buffer); -+ va_TraceMsg(trace_ctx, "\tbuffer location = 0x%p\n", buffer); - va_TraceMsg(trace_ctx, NULL); - - Y_data = (unsigned char*)buffer; -@@ -1668,7 +1668,7 @@ void va_TraceMapBuffer ( - va_TraceMsg(trace_ctx, "\t bit_offset = %u\n", buf_list->bit_offset); - va_TraceMsg(trace_ctx, "\t status = 0x%08x\n", buf_list->status); - va_TraceMsg(trace_ctx, "\t reserved = 0x%08x\n", buf_list->reserved); -- va_TraceMsg(trace_ctx, "\t buf = 0x%08x\n", buf_list->buf); -+ va_TraceMsg(trace_ctx, "\t buf = 0x%p\n", buf_list->buf); - - if (trace_ctx->trace_fp_codedbuf) { - va_TraceMsg(trace_ctx, "\tDump the content to file\n"); -@@ -1780,10 +1780,10 @@ static void va_TraceVAIQMatrixBufferMPEG2( - va_TraceMsg(trace_ctx,"\tload_non_intra_quantiser_matrix = %d\n", p->load_non_intra_quantiser_matrix); - va_TraceMsg(trace_ctx,"\tload_chroma_intra_quantiser_matrix = %d\n", p->load_chroma_intra_quantiser_matrix); - va_TraceMsg(trace_ctx,"\tload_chroma_non_intra_quantiser_matrix = %d\n", p->load_chroma_non_intra_quantiser_matrix); -- va_TraceMsg(trace_ctx,"\tintra_quantiser_matrix = %d\n", p->intra_quantiser_matrix); -- va_TraceMsg(trace_ctx,"\tnon_intra_quantiser_matrix = %d\n", p->non_intra_quantiser_matrix); -- va_TraceMsg(trace_ctx,"\tchroma_intra_quantiser_matrix = %d\n", p->chroma_intra_quantiser_matrix); -- va_TraceMsg(trace_ctx,"\tchroma_non_intra_quantiser_matrix = %d\n", p->chroma_non_intra_quantiser_matrix); -+ va_TraceMsg(trace_ctx,"\tintra_quantiser_matrix = %p\n", p->intra_quantiser_matrix); -+ va_TraceMsg(trace_ctx,"\tnon_intra_quantiser_matrix = %p\n", p->non_intra_quantiser_matrix); -+ va_TraceMsg(trace_ctx,"\tchroma_intra_quantiser_matrix = %p\n", p->chroma_intra_quantiser_matrix); -+ va_TraceMsg(trace_ctx,"\tchroma_non_intra_quantiser_matrix = %p\n", p->chroma_non_intra_quantiser_matrix); - va_TraceMsg(trace_ctx, NULL); - - return; -@@ -2054,7 +2054,7 @@ static void va_TraceVAEncSequenceParameterBufferMPEG2( - - va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period); - va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second); -- va_TraceMsg(trace_ctx, "\tframe_rate = %d\n", p->frame_rate); -+ va_TraceMsg(trace_ctx, "\tframe_rate = %f\n", p->frame_rate); - va_TraceMsg(trace_ctx, "\tvbv_buffer_size = %d\n", p->vbv_buffer_size); - va_TraceMsg(trace_ctx, NULL); - -@@ -5278,7 +5278,7 @@ void va_TracePutSurface ( - TRACE_FUNCNAME(idx); - - va_TraceMsg(trace_ctx, "\tsurface = 0x%08x\n", surface); -- va_TraceMsg(trace_ctx, "\tdraw = 0x%08x\n", draw); -+ va_TraceMsg(trace_ctx, "\tdraw = 0x%p\n", draw); - va_TraceMsg(trace_ctx, "\tsrcx = %d\n", srcx); - va_TraceMsg(trace_ctx, "\tsrcy = %d\n", srcy); - va_TraceMsg(trace_ctx, "\tsrcw = %d\n", srcw); -@@ -5287,7 +5287,7 @@ void va_TracePutSurface ( - va_TraceMsg(trace_ctx, "\tdesty = %d\n", desty); - va_TraceMsg(trace_ctx, "\tdestw = %d\n", destw); - va_TraceMsg(trace_ctx, "\tdesth = %d\n", desth); -- va_TraceMsg(trace_ctx, "\tcliprects = 0x%08x\n", cliprects); -+ va_TraceMsg(trace_ctx, "\tcliprects = 0x%p\n", cliprects); - va_TraceMsg(trace_ctx, "\tnumber_cliprects = %d\n", number_cliprects); - va_TraceMsg(trace_ctx, "\tflags = 0x%08x\n", flags); - va_TraceMsg(trace_ctx, NULL); diff --git a/SPECS/libva.spec b/SPECS/libva.spec index 53f6c77..5d9db16 100644 --- a/SPECS/libva.spec +++ b/SPECS/libva.spec @@ -1,11 +1,13 @@ Name: libva -Version: 2.5.0 +Version: 2.13.0 Release: 2%{?dist} Summary: Video Acceleration (VA) API for Linux License: MIT -URL: https://01.org/linuxmedia -Source0: https://github.com/01org/libva/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch0: libva-2.5.0-covscan.patch +URL: https://github.com/intel/libva +Source0: https://github.com/intel/libva/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: libva-2.13.0-crocus.patch +Patch1: libva-2.13.0-strong-sp.patch +Patch2: libva-2.13.0-covscan.patch BuildRequires: libtool @@ -71,6 +73,15 @@ find %{buildroot} -regex ".*\.la$" | xargs rm -f -- %{_libdir}/pkgconfig/libva*.pc %changelog +* Thu Jul 14 2022 Jiri Kucera - 2.13.0-2 +- Fix covscan issues + Related: #2099907 + +* Wed Jul 13 2022 Jiri Kucera - 2.13.0-1 +- Update to 2.13.0 + Add support for crocus DRI driver + Resolves: #2099907 + * Sat Nov 30 2019 Jiri Kucera - 2.5.0-2 - Fix issues found by static analysis Related: #1728792