Skip to content

Commit

Permalink
Merge branch 'master' into fix-lld17-build-1
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitryAndric authored May 4, 2024
2 parents 6b0efda + 1b7d71f commit 1663ce4
Show file tree
Hide file tree
Showing 28 changed files with 1,324 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: docs

permissions:
contents: read

on:
push:
paths-ignore:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: freebsd

permissions:
contents: read

on: [push, pull_request]

jobs:
freebsd:
runs-on: macos-12
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install prerequisites and build'
uses: vmactions/freebsd-vm@v0
uses: vmactions/freebsd-vm@v1
with:
prepare: |
pkg install -y meson pkgconf libdrm libXext libXfixes wayland
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:

- name: 'Upload the artifacts'
if: github.ref_name == env.GIT_LATEST_TAG
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: "_build/doc/html-out"

- name: 'Deploy to GitHub Pages'
if: github.ref_name == env.GIT_LATEST_TAG
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: style

permissions:
contents: read

on: [push, pull_request]

jobs:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: ubuntu

permissions:
contents: read

on: [push, pull_request]

env:
Expand Down
26 changes: 25 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: windows

permissions:
contents: read

on: [push, pull_request]

jobs:
Expand All @@ -9,7 +12,7 @@ jobs:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Python'
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: 'Install Meson'
Expand All @@ -24,6 +27,27 @@ jobs:
- name: 'Install'
run: meson install -C _build

windows-msvc-debug:
runs-on: windows-2022
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Python'
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: 'Install Meson'
run: pip install meson
- name: 'Enter DevShell'
run: '.github\workflows\EnterDevShell.ps1 ${{ inputs.architecture }}'
shell: pwsh
- name: 'Configure with meson'
run: meson setup _build -D werror=true -D buildtype=debug
- name: 'Build'
run: meson compile -C _build
- name: 'Install'
run: meson install -C _build

windows-mingw:
runs-on: windows-2022
env:
Expand Down
27 changes: 25 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
libva NEWS -- summary of user visible changes. 2023-09-14
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
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
5 changes: 3 additions & 2 deletions 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], [21])
m4_define([va_api_minor_version], [22])
m4_define([va_api_micro_version], [0])

m4_define([va_api_version],
Expand Down Expand Up @@ -75,7 +75,8 @@ m4_define([libva_lt_age],
[m4_eval(libva_binary_age - libva_interface_age)])

# libdrm minimun version requirement
m4_define([libdrm_version], [2.4.60])
# 2.4.75 for drmGetDevices2
m4_define([libdrm_version], [2.4.75])

# Wayland minimum version number
# 1.11.0 for wl_proxy_create_wrapper
Expand Down
8 changes: 5 additions & 3 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.21.0.1',
version : '2.22.0.1',
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 = 21
va_api_minor_version = 22
va_api_micro_version = 0

va_api_version = '@0@.@1@.@2@'.format(va_api_major_version,
Expand Down Expand Up @@ -85,7 +85,7 @@ cc = meson.get_compiler('c')
dl_dep = cc.find_library('dl', required : false)

WITH_DRM = not get_option('disable_drm') and (host_machine.system() != 'windows')
libdrm_dep = dependency('libdrm', version : '>= 2.4.60', required : (host_machine.system() != 'windows'))
libdrm_dep = dependency('libdrm', version : '>= 2.4.75', required : (host_machine.system() != 'windows'))

WITH_X11 = false
if get_option('with_x11') != 'no'
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')
4 changes: 4 additions & 0 deletions va/drm/va_drm_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ VA_DRM_GetDriverNames(VADriverContextP ctx, char **drivers, unsigned *num_driver
const char * const drm_driver;
const char * const va_driver[MAX_NAMES];
} map[] = {
{ "xe", { "iHD" } },
{ "i915", { "iHD", "i965" } }, // Intel Media and OTC GenX
{ "pvrsrvkm", { "pvr" } }, // Intel UMG PVR
{ "radeon", { "r600", "radeonsi" } }, // Mesa Gallium
Expand All @@ -71,6 +72,9 @@ VA_DRM_GetDriverNames(VADriverContextP ctx, char **drivers, unsigned *num_driver
char *drm_driver;
unsigned count = 0;

if (!drm_state || drm_state->fd < 0)
return VA_STATUS_ERROR_INVALID_DISPLAY;

drm_driver = va_DRM_GetDrmDriverName(drm_state->fd);
if (!drm_driver)
return VA_STATUS_ERROR_UNKNOWN;
Expand Down
2 changes: 2 additions & 0 deletions va/libva.def
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ EXPORTS
vaGetDisplayAttributes
vaGetImage
vaMapBuffer
vaMapBuffer2
vaMaxNumDisplayAttributes
vaMaxNumImageFormats
vaMaxNumSubpictureFormats
Expand Down Expand Up @@ -83,3 +84,4 @@ EXPORTS
vaStatusStr
vaSyncSurface2
vaDisplayIsValid
vaGetLibFunc
35 changes: 22 additions & 13 deletions va/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ if WITH_X11

libva_dri_headers = [
'x11/va_dri2.h',
'x11/va_dri3.h',
'x11/va_dricommon.h',
]

libva_x11_headers = ['va_x11.h'] + libva_dri_headers
libva_x11_headers = ['va_x11.h'] + libva_dri_headers + ['va_trace.h']

libva_headers_subproject += libva_dri_headers

Expand Down Expand Up @@ -227,6 +228,7 @@ endif
if WITH_WAYLAND
libva_wayland_sources = [
'wayland/va_wayland.c',
'wayland/va_wayland_linux_dmabuf.c',
'wayland/va_wayland_drm.c',
'wayland/va_wayland_emgd.c',
'drm/va_drm_utils.c',
Expand All @@ -240,24 +242,31 @@ if WITH_WAYLAND
libva_headers_subproject += libva_wayland_headers

libva_wayland_headers_priv = [
'wayland/va_wayland_linux_dmabuf.h',
'wayland/va_wayland_drm.h',
'wayland/va_wayland_emgd.h',
'wayland/va_wayland_private.h',
]

protocol_files = [
custom_target(
'wayland-drm-client-protocol.c',
output : 'wayland-drm-client-protocol.c',
input : 'wayland/wayland-drm.xml',
command : [wl_scanner, 'private-code', '@INPUT@', '@OUTPUT@']),

custom_target(
'wayland-drm-client-protocol.h',
output : 'wayland-drm-client-protocol.h',
input : 'wayland/wayland-drm.xml',
# XXX: grab linux-dmabuf-v1.xml from wayland-protocols
protocols = {
'wayland-drm': 'wayland/wayland-drm.xml',
'linux-dmabuf-v1': 'wayland/linux-dmabuf-v1.xml',
}

protocol_files = []
foreach name, xml : protocols
protocol_files += custom_target(
name + '-client-protocol.c',
output : name + '-client-protocol.c',
input : xml,
command : [wl_scanner, 'private-code', '@INPUT@', '@OUTPUT@'])
protocol_files += custom_target(
name + '-client-protocol.h',
output : name + '-client-protocol.h',
input : xml,
command : [wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
]
endforeach

install_headers(libva_wayland_headers, subdir : 'va')

Expand Down
35 changes: 32 additions & 3 deletions va/va.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,14 +1430,43 @@ VAStatus vaMapBuffer(
)
{
VADriverContextP ctx;
VAStatus va_status;
VAStatus va_status = VA_STATUS_SUCCESS;

CHECK_DISPLAY(dpy);
ctx = CTX(dpy);

if (ctx->vtable->vaMapBuffer2) {
va_status = ctx->vtable->vaMapBuffer2(ctx, buf_id, pbuf, VA_MAPBUFFER_FLAG_DEFAULT);
} else if (ctx->vtable->vaMapBuffer) {
va_status = ctx->vtable->vaMapBuffer(ctx, buf_id, pbuf);
}

VA_TRACE_ALL(va_TraceMapBuffer, dpy, buf_id, pbuf, VA_MAPBUFFER_FLAG_DEFAULT);
VA_TRACE_RET(dpy, va_status);

return va_status;
}

VAStatus vaMapBuffer2(
VADisplay dpy,
VABufferID buf_id, /* in */
void **pbuf, /* out */
uint32_t flags /*in */
)
{
VADriverContextP ctx;
VAStatus va_status = VA_STATUS_SUCCESS;

CHECK_DISPLAY(dpy);
ctx = CTX(dpy);

va_status = ctx->vtable->vaMapBuffer(ctx, buf_id, pbuf);
if (ctx->vtable->vaMapBuffer2) {
va_status = ctx->vtable->vaMapBuffer2(ctx, buf_id, pbuf, flags);
} else if (ctx->vtable->vaMapBuffer) {
va_status = ctx->vtable->vaMapBuffer(ctx, buf_id, pbuf);
}

VA_TRACE_ALL(va_TraceMapBuffer, dpy, buf_id, pbuf);
VA_TRACE_ALL(va_TraceMapBuffer, dpy, buf_id, pbuf, flags);
VA_TRACE_RET(dpy, va_status);

return va_status;
Expand Down
Loading

0 comments on commit 1663ce4

Please sign in to comment.