Commit 8cc766d8 authored by Mike Blumenkrantz's avatar Mike Blumenkrantz 🏋 Committed by Marge Bot
Browse files

remove xvmc



These seem abandoned and they make interfaces changes less easy.

Acked-by: default avatarMarek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
Part-of: <!18705>
parent 0b81ff01
......@@ -171,7 +171,6 @@ debian-build-testing:
-D dri3=enabled
-D gallium-extra-hud=true
-D gallium-vdpau=enabled
-D gallium-xvmc=enabled
-D gallium-omx=bellagio
-D gallium-va=enabled
-D gallium-xa=enabled
......@@ -183,7 +182,7 @@ debian-build-testing:
EXTRA_OPTION: >
-D spirv-to-dxil=true
-D osmesa=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,xvmc,lima,panfrost,asahi
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi
script:
- .gitlab-ci/lava/lava-pytest.sh
- .gitlab-ci/run-shellcheck.sh
......@@ -206,7 +205,6 @@ debian-release:
-D dri3=enabled
-D gallium-extra-hud=true
-D gallium-vdpau=enabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=enabled
-D gallium-xa=enabled
......@@ -257,7 +255,6 @@ fedora-release:
-D dri3=enabled
-D gallium-extra-hud=true
-D gallium-vdpau=enabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=enabled
-D gallium-xa=enabled
......@@ -304,7 +301,6 @@ debian-android:
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
......@@ -337,7 +333,6 @@ debian-android:
GALLIUM_ST: >
-D dri3=enabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
......@@ -438,7 +433,6 @@ debian-clang:
-D dri3=enabled
-D gallium-extra-hud=true
-D gallium-vdpau=enabled
-D gallium-xvmc=enabled
-D gallium-omx=bellagio
-D gallium-va=enabled
-D gallium-xa=enabled
......@@ -456,7 +450,7 @@ debian-clang:
-D spirv-to-dxil=true
-D osmesa=true
-D imagination-srv=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,xvmc,lima,panfrost,asahi,imagination
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi,imagination
-D vulkan-layers=device-select,overlay
-D build-aco-tests=true
-D intel-clc=enabled
......@@ -501,7 +495,6 @@ debian-clover:
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
......@@ -516,7 +509,6 @@ debian-rusticl:
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
......@@ -538,7 +530,6 @@ debian-vulkan:
GALLIUM_ST: >
-D dri3=enabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
......
......@@ -83,7 +83,6 @@ if with_tools.contains('all')
'lima',
'nir',
'nouveau',
'xvmc',
'asahi',
'imagination',
]
......@@ -695,47 +694,7 @@ if with_vulkan_overlay_layer or with_aco_tests or with_amd_vk
endif
endif
_xvmc = get_option('gallium-xvmc')
if _xvmc == 'true'
_xvmc = 'enabled'
warning('gallium-xvmc option "true" deprecated, please use "enabled" instead.')
elif _xvmc == 'false'
_xvmc = 'disabled'
warning('gallium-xvmc option "false" deprecated, please use "disabled" instead.')
endif
if not system_has_kms_drm
if _xvmc == 'enabled'
error('XVMC state tracker can only be build on unix-like OSes.')
else
_xvmc = 'disabled'
endif
elif not with_platform_x11
if _xvmc == 'enabled'
error('XVMC state tracker requires X11 support.')
else
_xvmc = 'disabled'
endif
elif not (with_gallium_r600 or with_gallium_nouveau)
if _xvmc == 'enabled'
error('XVMC state tracker requires at least one of the following gallium drivers: r600, nouveau.')
else
_xvmc = 'disabled'
endif
endif
dep_xvmc = null_dep
dep_xv = null_dep
with_gallium_xvmc = false
if _xvmc != 'disabled'
dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : _xvmc == 'enabled')
dep_xv = dependency('xv', required : _xvmc == 'enabled')
with_gallium_xvmc = dep_xvmc.found() and dep_xv.found()
endif
xvmc_drivers_path = get_option('xvmc-libs-path')
if xvmc_drivers_path == ''
xvmc_drivers_path = get_option('libdir')
endif
_omx = get_option('gallium-omx')
if not system_has_kms_drm
if ['auto', 'disabled'].contains(_omx)
......@@ -2152,7 +2111,7 @@ if with_platform_x11
dep_xcb_shm = dependency('xcb-shm')
endif
if (with_any_vk or with_glx == 'dri' or with_egl or
(with_gallium_vdpau or with_gallium_xvmc or with_gallium_va or
(with_gallium_vdpau or with_gallium_va or
with_gallium_omx != 'disabled'))
dep_xcb = dependency('xcb')
dep_x11_xcb = dependency('x11-xcb')
......@@ -2189,7 +2148,7 @@ if with_platform_x11
endif
if (with_egl or
with_dri3 or (
with_gallium_vdpau or with_gallium_xvmc or with_gallium_xa or
with_gallium_vdpau or with_gallium_xa or
with_gallium_omx != 'disabled'))
dep_xcb_xfixes = dependency('xcb-xfixes')
endif
......@@ -2408,9 +2367,6 @@ if with_gallium
if with_gallium_xa
gallium_st += 'xa'
endif
if with_gallium_xvmc
gallium_st += 'xvmc'
endif
if with_gallium_vdpau
gallium_st += 'vdpau'
endif
......
......@@ -98,19 +98,6 @@ option(
value : '',
description : 'path to put vdpau libraries. defaults to $libdir/vdpau.'
)
option(
'gallium-xvmc',
type : 'combo',
value : 'auto',
choices : ['auto', 'true', 'false', 'enabled', 'disabled'],
description : 'enable gallium xvmc frontend.',
)
option(
'xvmc-libs-path',
type : 'string',
value : '',
description : 'path to put xvmc libraries. defaults to $libdir.'
)
option(
'gallium-omx',
type : 'combo',
......@@ -448,7 +435,7 @@ option(
'tools',
type : 'array',
value : [],
choices : ['drm-shim', 'etnaviv', 'freedreno', 'glsl', 'intel', 'intel-ui', 'nir', 'nouveau', 'xvmc', 'lima', 'panfrost', 'asahi', 'imagination', 'all', 'dlclose-skip'],
choices : ['drm-shim', 'etnaviv', 'freedreno', 'glsl', 'intel', 'intel-ui', 'nir', 'nouveau', 'lima', 'panfrost', 'asahi', 'imagination', 'all', 'dlclose-skip'],
description : 'List of tools to build. (Note: `intel-ui` selects `intel`)',
)
option(
......
/**************************************************************************
*
* Copyright 2009 Younes Manton.
* 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 VMWARE 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.
*
**************************************************************************/
#include <assert.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xvlib.h>
#include <X11/extensions/XvMClib.h>
#include "vl/vl_compositor.h"
#include "xvmc_private.h"
#define XV_BRIGHTNESS "XV_BRIGHTNESS"
#define XV_CONTRAST "XV_CONTRAST"
#define XV_SATURATION "XV_SATURATION"
#define XV_HUE "XV_HUE"
#define XV_COLORSPACE "XV_COLORSPACE"
static const XvAttribute attributes[] = {
{ XvGettable | XvSettable, -1000, 1000, XV_BRIGHTNESS },
{ XvGettable | XvSettable, -1000, 1000, XV_CONTRAST },
{ XvGettable | XvSettable, -1000, 1000, XV_SATURATION },
{ XvGettable | XvSettable, -1000, 1000, XV_HUE },
{ XvGettable | XvSettable, 0, 1, XV_COLORSPACE }
};
PUBLIC
XvAttribute* XvMCQueryAttributes(Display *dpy, XvMCContext *context, int *number)
{
XvAttribute *result;
assert(dpy && number);
if (!context || !context->privData)
return NULL;
result = malloc(sizeof(attributes));
if (!result)
return NULL;
memcpy(result, attributes, sizeof(attributes));
*number = sizeof(attributes) / sizeof(XvAttribute);
XVMC_MSG(XVMC_TRACE, "[XvMC] Returning %d attributes for context %p.\n", *number, context);
return result;
}
PUBLIC
Status XvMCSetAttribute(Display *dpy, XvMCContext *context, Atom attribute, int value)
{
XvMCContextPrivate *context_priv;
const char *attr;
vl_csc_matrix csc;
assert(dpy);
if (!context || !context->privData)
return XvMCBadContext;
context_priv = context->privData;
attr = XGetAtomName(dpy, attribute);
if (!attr)
return XvMCBadContext;
if (strcmp(attr, XV_BRIGHTNESS) == 0)
context_priv->procamp.brightness = value / 1000.0f;
else if (strcmp(attr, XV_CONTRAST) == 0)
context_priv->procamp.contrast = value / 1000.0f + 1.0f;
else if (strcmp(attr, XV_SATURATION) == 0)
context_priv->procamp.saturation = value / 1000.0f + 1.0f;
else if (strcmp(attr, XV_HUE) == 0)
context_priv->procamp.hue = value / 1000.0f;
else if (strcmp(attr, XV_COLORSPACE) == 0)
context_priv->color_standard = value ?
VL_CSC_COLOR_STANDARD_BT_601 :
VL_CSC_COLOR_STANDARD_BT_709;
else
return BadName;
vl_csc_get_matrix
(
context_priv->color_standard,
&context_priv->procamp, true, &csc
);
vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc, 1.0f, 0.0f);
XVMC_MSG(XVMC_TRACE, "[XvMC] Set attribute %s to value %d.\n", attr, value);
return Success;
}
PUBLIC
Status XvMCGetAttribute(Display *dpy, XvMCContext *context, Atom attribute, int *value)
{
XvMCContextPrivate *context_priv;
const char *attr;
assert(dpy);
if (!context || !context->privData)
return XvMCBadContext;
context_priv = context->privData;
attr = XGetAtomName(dpy, attribute);
if (!attr)
return XvMCBadContext;
if (strcmp(attr, XV_BRIGHTNESS) == 0)
*value = context_priv->procamp.brightness * 1000;
else if (strcmp(attr, XV_CONTRAST) == 0)
*value = context_priv->procamp.contrast * 1000 - 1000;
else if (strcmp(attr, XV_SATURATION) == 0)
*value = context_priv->procamp.saturation * 1000 + 1000;
else if (strcmp(attr, XV_HUE) == 0)
*value = context_priv->procamp.hue * 1000;
else if (strcmp(attr, XV_COLORSPACE) == 0)
*value = context_priv->color_standard == VL_CSC_COLOR_STANDARD_BT_709;
else
return BadName;
XVMC_MSG(XVMC_TRACE, "[XvMC] Got value %d for attribute %s.\n", *value, attr);
return Success;
}
/**************************************************************************
*
* Copyright 2009 Younes Manton.
* 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 VMWARE 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.
*
**************************************************************************/
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/extensions/XvMClib.h>
#include "util/u_memory.h"
#include "xvmc_private.h"
PUBLIC
Status XvMCCreateBlocks(Display *dpy, XvMCContext *context, unsigned int num_blocks, XvMCBlockArray *blocks)
{
assert(dpy);
if (!context)
return XvMCBadContext;
if (num_blocks == 0)
return BadValue;
assert(blocks);
blocks->context_id = context->context_id;
blocks->num_blocks = num_blocks;
blocks->blocks = MALLOC(BLOCK_SIZE_BYTES * num_blocks);
blocks->privData = NULL;
return Success;
}
PUBLIC
Status XvMCDestroyBlocks(Display *dpy, XvMCBlockArray *blocks)
{
assert(dpy);
assert(blocks);
FREE(blocks->blocks);
return Success;
}
PUBLIC
Status XvMCCreateMacroBlocks(Display *dpy, XvMCContext *context, unsigned int num_blocks, XvMCMacroBlockArray *blocks)
{
assert(dpy);
if (!context)
return XvMCBadContext;
if (num_blocks == 0)
return BadValue;
assert(blocks);
blocks->context_id = context->context_id;
blocks->num_blocks = num_blocks;
blocks->macro_blocks = MALLOC(sizeof(XvMCMacroBlock) * num_blocks);
blocks->privData = NULL;
return Success;
}
PUBLIC
Status XvMCDestroyMacroBlocks(Display *dpy, XvMCMacroBlockArray *blocks)
{
assert(dpy);
assert(blocks);
FREE(blocks->macro_blocks);
return Success;
}
/**************************************************************************
*
* Copyright 2009 Younes Manton.
* 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 VMWARE 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.
*
**************************************************************************/
#include <assert.h>
#include <X11/Xlibint.h>
#include <X11/extensions/XvMClib.h>
#include "pipe/p_screen.h"
#include "pipe/p_video_codec.h"
#include "pipe/p_video_state.h"
#include "pipe/p_state.h"
#include "util/u_memory.h"
#include "vl/vl_csc.h"
#include "vl/vl_winsys.h"
#include "xvmc_private.h"
static Status Validate(Display *dpy, XvPortID port, int surface_type_id,
unsigned int width, unsigned int height, int flags,
bool *found_port, int *screen, int *chroma_format,
int *mc_type, int *surface_flags,
unsigned short *subpic_max_w,
unsigned short *subpic_max_h)
{
bool found_surface = false;
XvAdaptorInfo *adaptor_info;
unsigned int num_adaptors;
int num_types;
unsigned int max_width = 0, max_height = 0;
Status ret;
assert(dpy);
assert(found_port);
assert(screen);
assert(chroma_format);
assert(mc_type);
assert(surface_flags);
assert(subpic_max_w);
assert(subpic_max_h);
*found_port = false;
for (int i = 0; i < XScreenCount(dpy); ++i) {
ret = XvQueryAdaptors(dpy, XRootWindow(dpy, i), &num_adaptors, &adaptor_info);
if (ret != Success)
return ret;
for (unsigned int j = 0; j < num_adaptors && !*found_port; ++j) {
for (unsigned int k = 0; k < adaptor_info[j].num_ports && !*found_port; ++k) {
XvMCSurfaceInfo *surface_info;
if (adaptor_info[j].base_id + k != port)
continue;
*found_port = true;
surface_info = XvMCListSurfaceTypes(dpy, adaptor_info[j].base_id, &num_types);
if (!surface_info) {
XvFreeAdaptorInfo(adaptor_info);
return BadAlloc;
}
for (int l = 0; l < num_types && !found_surface; ++l) {
if (surface_info[l].surface_type_id != surface_type_id)
continue;
found_surface = true;
max_width = surface_info[l].max_width;
max_height = surface_info[l].max_height;
*chroma_format = surface_info[l].chroma_format;
*mc_type = surface_info[l].mc_type;
*surface_flags = surface_info[l].flags;
*subpic_max_w = surface_info[l].subpicture_max_width;
*subpic_max_h = surface_info[l].subpicture_max_height;
*screen = i;
XVMC_MSG(XVMC_TRACE, "[XvMC] Found requested context surface format.\n" \
"[XvMC] screen=%u, port=%u\n" \
"[XvMC] id=0x%08X\n" \
"[XvMC] max width=%u, max height=%u\n" \
"[XvMC] chroma format=0x%08X\n" \
"[XvMC] acceleration level=0x%08X\n" \
"[XvMC] flags=0x%08X\n" \
"[XvMC] subpicture max width=%u, max height=%u\n",
i, port, surface_type_id, max_width, max_height, *chroma_format,
*mc_type, *surface_flags, *subpic_max_w, *subpic_max_h);
}
free(surface_info);
}
}
XvFreeAdaptorInfo(adaptor_info);
}
if (!*found_port) {
XVMC_MSG(XVMC_ERR, "[XvMC] Could not find a suitable port.\n");
return XvBadPort;
}
if (!found_surface) {
XVMC_MSG(XVMC_ERR, "[XvMC] Could not find a suitable surface.\n");
return BadMatch;
}
if (width > max_width || height > max_height) {
XVMC_MSG(XVMC_ERR, "[XvMC] Requested context dimensions (w=%u,h=%u) too large (max w=%u,h=%u).\n",
width, height, max_width, max_height);
return BadValue;
}
if (flags != XVMC_DIRECT && flags != 0) {
XVMC_MSG(XVMC_ERR, "[XvMC] Invalid context flags 0x%08X.\n", flags);
return BadValue;
}
return Success;
}
static enum pipe_video_profile ProfileToPipe(int xvmc_profile)
{
if (xvmc_profile & XVMC_MPEG_1)
assert(0);
if (xvmc_profile & XVMC_MPEG_2)
return PIPE_VIDEO_PROFILE_MPEG2_MAIN;
if (xvmc_profile & XVMC_H263)
assert(0);
if (xvmc_profile & XVMC_MPEG_4)
assert(0);
assert(0);
XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized profile 0x%08X.\n", xvmc_profile);
return -1;
}
static enum pipe_video_chroma_format FormatToPipe(int xvmc_format)
{
switch (xvmc_format) {
case XVMC_CHROMA_FORMAT_420:
return PIPE_VIDEO_CHROMA_FORMAT_420;
case XVMC_CHROMA_FORMAT_422:
return PIPE_VIDEO_CHROMA_FORMAT_422;
case XVMC_CHROMA_FORMAT_444:
return PIPE_VIDEO_CHROMA_FORMAT_444;
default: