From 4c7d91b8a19a13176aed3f61e61f238cd673e051 Mon Sep 17 00:00:00 2001 From: Shaofeng Tang Date: Mon, 27 Feb 2023 23:31:00 +0800 Subject: [PATCH] Upgrade Libva to 2.17.0 Upgrade to libva release tag: https://github.com/intel/libva/releases/tag/2.17.0 Remove va_version.h from gitignore and add va_version.h for Android. Signed-off-by: Shaofeng Tang --- .gitignore | 1 - va/Android.mk | 65 +++++++++++++++++++++++++++++------- va/va_version.h | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 12 deletions(-) create mode 100644 va/va_version.h diff --git a/.gitignore b/.gitignore index 18d0234b..e63b8ed0 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ ltmain.sh /m4 missing stamp-h1 -/va/va_version.h /va/wayland/wayland-drm-client-protocol.* /doc/Doxyfile /doc/html-out diff --git a/va/Android.mk b/va/Android.mk index 050c3778..19e78c40 100644 --- a/va/Android.mk +++ b/va/Android.mk @@ -25,8 +25,8 @@ LOCAL_PATH:= $(call my-dir) -LIBVA_DRIVERS_PATH_32 := /vendor/lib/dri -LIBVA_DRIVERS_PATH_64 := /vendor/lib64/dri +LIBVA_DRIVERS_PATH_32 := /vendor/lib +LIBVA_DRIVERS_PATH_64 := /vendor/lib64 include $(CLEAR_VARS) @@ -41,7 +41,10 @@ IGNORED_WARNNING = \ LOCAL_SRC_FILES := \ va.c \ va_trace.c \ - va_str.c + va_str.c \ + drm/va_drm.c \ + drm/va_drm_auth.c \ + drm/va_drm_utils.c LOCAL_CFLAGS_32 += \ -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH_32)\"" \ @@ -52,16 +55,56 @@ LOCAL_CFLAGS_64 += \ LOCAL_CFLAGS := \ $(IGNORED_WARNNING) \ $(if $(filter user,$(TARGET_BUILD_VARIANT)),,-DENABLE_VA_MESSAGING) \ - -DLOG_TAG=\"libva\" + -DLOG_TAG=\"libva\" \ + -DSYSCONFDIR='"$(sysconfdir)"' LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. +LOCAL_COPY_HEADERS := \ + va.h \ + va_android.h \ + va_version.h \ + va_dec_hevc.h \ + va_dec_jpeg.h \ + va_dec_vp8.h \ + va_dec_vp9.h \ + va_enc_hevc.h \ + va_enc_h264.h \ + va_enc_jpeg.h \ + va_enc_vp8.h \ + va_enc_av1.h \ + va_backend.h \ + va_drmcommon.h \ + va_vpp.h \ + va_backend_prot.h \ + va_backend_vpp.h \ + va_enc_mpeg2.h \ + sysdeps.h \ + va_compat.h \ + va_egl.h \ + va_prot.h \ + va_enc_vp9.h \ + va_fei.h \ + va_fei_h264.h \ + va_fei_hevc.h \ + va_internal.h \ + va_str.h \ + va_tpi.h \ + va_trace.h \ + va_dec_av1.h \ + drm/va_drm.h + +LOCAL_COPY_HEADERS_TO := libva/va + LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libva LOCAL_MODULE_CLASS := SHARED_LIBRARIES LOCAL_PROPRIETARY_MODULE := true LOCAL_SHARED_LIBRARIES := libdl libdrm libcutils liblog +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0) +LOCAL_HEADER_LIBRARIES += libutils_headers +endif intermediates := $(call local-generated-sources-dir) @@ -69,13 +112,6 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \ $(intermediates) \ $(LOCAL_C_INCLUDES) -GEN := $(intermediates)/va/va_version.h -$(GEN): SCRIPT := $(LOCAL_PATH)/../build/gen_version.sh -$(GEN): PRIVATE_CUSTOM_TOOL = sh $(SCRIPT) $( $@ -$(GEN): $(intermediates)/va/%.h : $(LOCAL_PATH)/%.h.in $(LOCAL_PATH)/../configure.ac - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - include $(BUILD_SHARED_LIBRARY) # For libva-android @@ -94,10 +130,17 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES += \ $(LOCAL_PATH)/drm +LOCAL_COPY_HEADERS_TO := libva/va + LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libva-android LOCAL_PROPRIETARY_MODULE := true LOCAL_SHARED_LIBRARIES := libva libdrm liblog +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0) +LOCAL_STATIC_LIBRARIES += libarect +LOCAL_HEADER_LIBRARIES += libnativebase_headers libutils_headers +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/va/va_version.h b/va/va_version.h new file mode 100644 index 00000000..33f6ea67 --- /dev/null +++ b/va/va_version.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2021 Splitted-Desktop Systems. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef VA_VERSION_H +#define VA_VERSION_H + +/** + * VA_MAJOR_VERSION: + * + * The major version of VA-API (1, if %VA_VERSION is 1.2.3) + */ +#define VA_MAJOR_VERSION 2 + +/** + * VA_MINOR_VERSION: + * + * The minor version of VA-API (2, if %VA_VERSION is 1.2.3) + */ +#define VA_MINOR_VERSION 17 + +/** + * VA_MICRO_VERSION: + * + * The micro version of VA-API (3, if %VA_VERSION is 1.2.3) + */ +#define VA_MICRO_VERSION 0 + +/** + * VA_VERSION: + * + * The full version of VA-API, like 1.2.3 + */ +#define VA_VERSION 2.17.0 + +/** + * VA_VERSION_S: + * + * The full version of VA-API, in string form (suited for string + * concatenation) + */ +#define VA_VERSION_S "2.17.0" + +/** + * VA_VERSION_HEX: + * + * Numerically encoded version of VA-API, like 0x010203 + */ +#define VA_VERSION_HEX ((VA_MAJOR_VERSION << 24) | \ + (VA_MINOR_VERSION << 16) | \ + (VA_MICRO_VERSION << 8)) + +/** + * VA_CHECK_VERSION: + * @major: major version, like 1 in 1.2.3 + * @minor: minor version, like 2 in 1.2.3 + * @micro: micro version, like 3 in 1.2.3 + * + * Evaluates to %TRUE if the version of VA-API is greater than + * @major, @minor and @micro + */ +#define VA_CHECK_VERSION(major,minor,micro) \ + (VA_MAJOR_VERSION > (major) || \ + (VA_MAJOR_VERSION == (major) && VA_MINOR_VERSION > (minor)) || \ + (VA_MAJOR_VERSION == (major) && VA_MINOR_VERSION == (minor) && VA_MICRO_VERSION >= (micro))) + +#endif /* VA_VERSION_H */