1 /**************************************************************************
3 * Copyright 2016 Advanced Micro Devices, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
30 * Christian König <christian.koenig@amd.com>
34 #ifndef _VDPAU_DMABUF_H_
35 #define _VDPAU_DMABUF_H_
37 #include <vdpau/vdpau.h>
39 /* driver specific functions for NV_vdpau_interop */
40 #ifndef VDP_FUNC_ID_BASE_DRIVER
41 #define VDP_FUNC_ID_BASE_DRIVER 0x2000
44 /* New DMA-buf based implementation */
45 #define VDP_FUNC_ID_VIDEO_SURFACE_DMA_BUF (VDP_FUNC_ID_BASE_DRIVER + 2)
46 #define VDP_FUNC_ID_OUTPUT_SURFACE_DMA_BUF (VDP_FUNC_ID_BASE_DRIVER + 3)
48 /* Define some more internal RGBA formats for more
49 * robust handling of Video Surfaces
51 #define VDP_RGBA_FORMAT_R8 (-1)
52 #define VDP_RGBA_FORMAT_R8G8 (-2)
54 struct VdpSurfaceDMABufDesc
{
55 /* DMA-buf file descriptor */
65 /* VDP_RGBA_FORMAT_* as defined in the VDPAU spec and above. */
70 * \brief Video surface planes
72 typedef uint32_t VdpVideoSurfacePlane
;
74 /** \hideinitializer \brief Luma top field */
75 #define VDP_VIDEO_SURFACE_PLANE_LUMA_TOP ((VdpVideoSurfacePlane)0)
76 /** \hideinitializer \brief Luma bottom field */
77 #define VDP_VIDEO_SURFACE_PLANE_LUMA_BOTTOM ((VdpVideoSurfacePlane)1)
78 /** \hideinitializer \brief Chroma top field */
79 #define VDP_VIDEO_SURFACE_PLANE_CHROMA_TOP ((VdpVideoSurfacePlane)2)
80 /** \hideinitializer \brief Chroma bottom field */
81 #define VDP_VIDEO_SURFACE_PLANE_CHROMA_BOTTOM ((VdpVideoSurfacePlane)3)
83 typedef VdpStatus
VdpVideoSurfaceDMABuf(
84 VdpVideoSurface surface
,
85 VdpVideoSurfacePlane plane
,
86 struct VdpSurfaceDMABufDesc
* result
89 typedef VdpStatus
VdpOutputSurfaceDMABuf(
90 VdpOutputSurface surface
,
91 struct VdpSurfaceDMABufDesc
* result
94 #endif /* _VDPAU_DMABUF_H_ */