Path: blob/21.2-virgl/src/gallium/drivers/radeon/radeon_video.h
4570 views
/**************************************************************************1*2* Copyright 2013 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#ifndef RADEON_VIDEO_H28#define RADEON_VIDEO_H2930#include "radeon/radeon_winsys.h"31#include "vl/vl_video_buffer.h"3233#define RVID_ERR(fmt, args...) \34fprintf(stderr, "EE %s:%d %s UVD - " fmt, __FILE__, __LINE__, __func__, ##args)3536#define UVD_FW_1_66_16 ((1 << 24) | (66 << 16) | (16 << 8))3738/* video buffer representation */39struct rvid_buffer {40unsigned usage;41struct si_resource *res;42};4344/* generate an stream handle */45unsigned si_vid_alloc_stream_handle(void);4647/* create a buffer in the winsys */48bool si_vid_create_buffer(struct pipe_screen *screen, struct rvid_buffer *buffer, unsigned size,49unsigned usage);5051/* create a tmz buffer in the winsys */52bool si_vid_create_tmz_buffer(struct pipe_screen *screen, struct rvid_buffer *buffer, unsigned size,53unsigned usage);5455/* destroy a buffer */56void si_vid_destroy_buffer(struct rvid_buffer *buffer);5758/* reallocate a buffer, preserving its content */59bool si_vid_resize_buffer(struct pipe_screen *screen, struct radeon_cmdbuf *cs,60struct rvid_buffer *new_buf, unsigned new_size);6162/* clear the buffer with zeros */63void si_vid_clear_buffer(struct pipe_context *context, struct rvid_buffer *buffer);6465#endif // RADEON_VIDEO_H666768