Path: blob/21.2-virgl/src/gallium/include/frontend/vdpau_dmabuf.h
4565 views
/**************************************************************************1*2* Copyright 2016 Advanced Micro Devices, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627/*28* Authors:29* Christian König <[email protected]>30*31*/3233#ifndef _VDPAU_DMABUF_H_34#define _VDPAU_DMABUF_H_3536#include <vdpau/vdpau.h>3738/* driver specific functions for NV_vdpau_interop */39#ifndef VDP_FUNC_ID_BASE_DRIVER40#define VDP_FUNC_ID_BASE_DRIVER 0x200041#endif4243/* New DMA-buf based implementation */44#define VDP_FUNC_ID_VIDEO_SURFACE_DMA_BUF (VDP_FUNC_ID_BASE_DRIVER + 2)45#define VDP_FUNC_ID_OUTPUT_SURFACE_DMA_BUF (VDP_FUNC_ID_BASE_DRIVER + 3)4647/* Define some more internal RGBA formats for more48* robust handling of Video Surfaces49*/50#define VDP_RGBA_FORMAT_R8 (-1)51#define VDP_RGBA_FORMAT_R8G8 (-2)5253struct VdpSurfaceDMABufDesc {54/* DMA-buf file descriptor */55uint32_t handle;56/* Width in pixel */57uint32_t width;58/* Height in pixel */59uint32_t height;60/* Offset in bytes */61uint32_t offset;62/* Stride in bytes */63uint32_t stride;64/* VDP_RGBA_FORMAT_* as defined in the VDPAU spec and above. */65uint32_t format;66};6768/**69* \brief Video surface planes70*/71typedef uint32_t VdpVideoSurfacePlane;7273/** \hideinitializer \brief Luma top field */74#define VDP_VIDEO_SURFACE_PLANE_LUMA_TOP ((VdpVideoSurfacePlane)0)75/** \hideinitializer \brief Luma bottom field */76#define VDP_VIDEO_SURFACE_PLANE_LUMA_BOTTOM ((VdpVideoSurfacePlane)1)77/** \hideinitializer \brief Chroma top field */78#define VDP_VIDEO_SURFACE_PLANE_CHROMA_TOP ((VdpVideoSurfacePlane)2)79/** \hideinitializer \brief Chroma bottom field */80#define VDP_VIDEO_SURFACE_PLANE_CHROMA_BOTTOM ((VdpVideoSurfacePlane)3)8182typedef VdpStatus VdpVideoSurfaceDMABuf(83VdpVideoSurface surface,84VdpVideoSurfacePlane plane,85struct VdpSurfaceDMABufDesc * result86);8788typedef VdpStatus VdpOutputSurfaceDMABuf(89VdpOutputSurface surface,90struct VdpSurfaceDMABufDesc * result91);9293#endif /* _VDPAU_DMABUF_H_ */949596