Skip to content

Commit

Permalink
Upgrade to 2.21.0
Browse files Browse the repository at this point in the history
https://github.com/intel/libva/releases/tag/2.21.0

Tracked-On: OAM-117146
Signed-off-by: zhangyichix <[email protected]>
  • Loading branch information
zhangyichix committed Apr 8, 2024
1 parent 2787a79 commit f5a807f
Show file tree
Hide file tree
Showing 34 changed files with 729 additions and 559 deletions.
55 changes: 53 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
libva NEWS -- summary of user visible changes. 2023-07-04
Copyright (C) 2009-2023 Intel Corporation
libva NEWS -- summary of user visible changes. 2024-03-12
Copyright (C) 2009-2024 Intel Corporation

version 2.21.0 - 12.Mar.2024
* va: Add allow_content_tools and force_intger_mv to AV1 enc
* va: add VASurfaceAttribAlignmentSize
* va: Re-add drm_state and fd checks to VA_DRM_GetDriverNames
* va: export symbol vaGetLibFunc for Windows
* va: Add PRIME3 defination and correct the value
* va: add driver name map for new intel KMD xe
* va: export symbol vaMapBuffer2 for Windows
* va: add new interface vaMapBuffer2 for map operation optimization
* va: Add VAConfigAttribEncMaxTileRows and VAConfigAttribEncMaxTileCols
* va: fix handling when all wayland backends fail
* va_trace:add return value trace for vaPutSurfaces
* ci: harden permissions for all github workflows
* ci: update to vmactions/freebsd-vm from v0 to v1
* ci: windows.yml: Add windows-msvc-debug
* meson: create dist archives suitable for building with configure, too
* autogen.sh: successfully detect if the autoreconf program is installed
* build(deps): bump actions/upload-pages-artifact from 2 to 3
* build(deps): bump actions/deploy-pages from 3 to 4
* build(deps): bump actions/setup-python from 4 to 5
* build(deps): bump actions/deploy-pages from 2 to 3
* win32: Fix debug build break

version 2.20.0 - 14.Sep.2023
* va: drop no longer applicable vaGetDriverNames check
* va: remove unreachable "DRIVER BUG"
* x11/dri2: limit the array handling to avoid out of range access
* va/backend: document the vaGetDriver* APIs
* va/backend: annotate vafool as deprecated
* win32: remove duplicate adapter_luid entry
* va: Added Q416 fourcc (three-plane 16-bit YUV 4:4:4)
* trace: fix minor issue about printf data type and value range
* jpeg: add support for crop and partial decode
* trace: Unlock mutex before return
* trace: Add trace for vaExportSurfaceHandle
* av1: Revise offsets comments for av1 encode
* va: Add new VADecodeErrorType to indicate the reset happended in the driver.
* drm: limit the array size to avoid out of range
* va: fix:set driver number to be zero if vaGetDriverNames failed
* va: fix:don't leak driver names, when override is set
* win32: Only print win32 driver messages in DEBUG builds
* va: Add vendor string on va_TraceInitialize
* va: remove legacy code paths
* drm: remove no longer used helpers
* x11: remove legacy code paths
* x11: allow disabling DRI3 via LIBVA_DRI3_DISABLE env var
* x11: implement vaGetDriverNames
* va/x11/va_nvctrl: remove some dead code
* va/x11/va_fglrx: remove some dead code
* va: optimize code of getting driver name for all protocols/os(wayland,x11,drm,win32,android)

version 2.19.0 - 04.Jul.2023
* docs: fix references and descriptions snf focyhrn mstkup
Expand Down
9 changes: 8 additions & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@

PROJECT="libva"

# for `meson dist`
if test -z "$srcdir"; then
srcdir="$MESON_PROJECT_DIST_ROOT"
test -n "$srcdir" || srcdir="$MESON_DIST_ROOT"
test -n "$srcdir" && NOCONFIGURE=1
fi

test -n "$srcdir" || srcdir="`dirname \"$0\"`"
test -n "$srcdir" || srcdir=.

Expand All @@ -36,7 +43,7 @@ cd "$srcdir"

mkdir -p m4

AUTORECONF=`which autoreconf`
AUTORECONF=`command -v autoreconf`
if test -z $AUTORECONF; then
echo "*** No autoreconf found ***"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# - reset micro version to zero when minor version is incremented
# - reset minor version to zero when major version is incremented
m4_define([va_api_major_version], [1])
m4_define([va_api_minor_version], [19])
m4_define([va_api_minor_version], [21])
m4_define([va_api_micro_version], [0])

m4_define([va_api_version],
Expand Down
6 changes: 4 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# - reset micro version to zero when VA-API major or minor version is changed
project(
'libva', 'c',
version : '2.19.0',
version : '2.21.0',
meson_version : '>= 0.53.0',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized' ])
Expand All @@ -19,7 +19,7 @@ project(
# - reset micro version to zero when minor version is incremented
# - reset minor version to zero when major version is incremented
va_api_major_version = 1
va_api_minor_version = 19
va_api_minor_version = 21
va_api_micro_version = 0

va_api_version = '@0@.@1@.@2@'.format(va_api_major_version,
Expand Down Expand Up @@ -157,3 +157,5 @@ doxygen = find_program('doxygen', required: false)
if get_option('enable_docs') and doxygen.found()
subdir('doc')
endif

meson.add_dist_script('./autogen.sh')
28 changes: 14 additions & 14 deletions va/android/va_android.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2007 Intel Corporation. All Rights Reserved.
* Copyright (c) 2023 Emil Velikov
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
Expand Down Expand Up @@ -61,38 +62,38 @@ static void va_DisplayContextDestroy(
free(pDisplayContext);
}

static VAStatus va_DisplayContextGetNumCandidates(
VADisplayContextP pDisplayContext,
int *num_candidates
static VAStatus va_DisplayContextConnect(
VADisplayContextP pDisplayContext
)
{
VADriverContextP const ctx = pDisplayContext->pDriverContext;
struct drm_state * drm_state = (struct drm_state *)ctx->drm_state;
struct drm_state * const drm_state = (struct drm_state *)ctx->drm_state;

memset(drm_state, 0, sizeof(*drm_state));
drm_state->fd = open(DEVICE_NAME, O_RDWR | O_CLOEXEC);

if (drm_state->fd < 0) {
fprintf(stderr, "Cannot open DRM device '%s': %d, %s\n",
DEVICE_NAME, errno, strerror(errno));
return VA_STATUS_ERROR_UNKNOWN;
}
drm_state->auth_type = VA_DRM_AUTH_CUSTOM;
return VA_DRM_GetNumCandidates(ctx, num_candidates);
return VA_STATUS_SUCCESS;
}

static VAStatus va_DisplayContextGetDriverNameByIndex(
static VAStatus
va_DisplayContextGetDriverNames(
VADisplayContextP pDisplayContext,
char **driver_name,
int candidate_index
char **drivers,
unsigned *num_drivers
)
{
VADriverContextP const ctx = pDisplayContext->pDriverContext;
VAStatus status = va_DisplayContextConnect(pDisplayContext);
if (status != VA_STATUS_SUCCESS)
return status;

return VA_DRM_GetDriverName(ctx, driver_name, candidate_index);
return VA_DRM_GetDriverNames(ctx, drivers, num_drivers);
}


VADisplay vaGetDisplay(
void *native_dpy /* implementation specific */
)
Expand All @@ -109,8 +110,7 @@ VADisplay vaGetDisplay(
return NULL;

pDisplayContext->vaDestroy = va_DisplayContextDestroy;
pDisplayContext->vaGetDriverNameByIndex = va_DisplayContextGetDriverNameByIndex;
pDisplayContext->vaGetNumCandidates = va_DisplayContextGetNumCandidates;
pDisplayContext->vaGetDriverNames = va_DisplayContextGetDriverNames;

pDriverContext = va_newDriverContext(pDisplayContext);
if (!pDriverContext) {
Expand Down
29 changes: 15 additions & 14 deletions va/drm/va_drm.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012 Intel Corporation. All Rights Reserved.
* Copyright (c) 2023 Emil Velikov
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
Expand Down Expand Up @@ -41,19 +42,17 @@ va_DisplayContextDestroy(VADisplayContextP pDisplayContext)
free(pDisplayContext->pDriverContext);
free(pDisplayContext);
}
static VAStatus va_DisplayContextGetNumCandidates(
VADisplayContextP pDisplayContext,
int *num_candidates


static VAStatus va_DisplayContextConnect(
VADisplayContextP pDisplayContext
)
{
VADriverContextP const ctx = pDisplayContext->pDriverContext;
struct drm_state * const drm_state = ctx->drm_state;
VAStatus status = VA_STATUS_SUCCESS;
drm_magic_t magic;
int ret;
status = VA_DRM_GetNumCandidates(ctx, num_candidates);
if (status != VA_STATUS_SUCCESS)
return status;

/* Authentication is only needed for a legacy DRM device */
if (ctx->display_type != VA_DISPLAY_DRM_RENDERNODES) {
ret = drmGetMagic(drm_state->fd, &magic);
Expand All @@ -68,17 +67,20 @@ static VAStatus va_DisplayContextGetNumCandidates(
return VA_STATUS_SUCCESS;
}


static VAStatus
va_DisplayContextGetDriverNameByIndex(
va_DisplayContextGetDriverNames(
VADisplayContextP pDisplayContext,
char **driver_name_ptr,
int candidate_index
char **drivers,
unsigned *num_drivers
)
{

VADriverContextP const ctx = pDisplayContext->pDriverContext;
VAStatus status = va_DisplayContextConnect(pDisplayContext);
if (status != VA_STATUS_SUCCESS)
return status;

return VA_DRM_GetDriverName(ctx, driver_name_ptr, candidate_index);
return VA_DRM_GetDriverNames(ctx, drivers, num_drivers);
}

VADisplay
Expand All @@ -104,8 +106,7 @@ vaGetDisplayDRM(int fd)
goto error;

pDisplayContext->vaDestroy = va_DisplayContextDestroy;
pDisplayContext->vaGetNumCandidates = va_DisplayContextGetNumCandidates;
pDisplayContext->vaGetDriverNameByIndex = va_DisplayContextGetDriverNameByIndex;
pDisplayContext->vaGetDriverNames = va_DisplayContextGetDriverNames;

pDriverContext = va_newDriverContext(pDisplayContext);
if (!pDriverContext)
Expand Down
Loading

0 comments on commit f5a807f

Please sign in to comment.