5ef0a21346232ef1809877662d94be96be9e9777
1 /**************************************************************************
3 * Copyright 2013 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 **************************************************************************/
28 #ifndef RADEON_VIDEO_H
29 #define RADEON_VIDEO_H
31 #include "radeon/radeon_winsys.h"
32 #include "vl/vl_video_buffer.h"
34 #define RVID_ERR(fmt, args...) \
35 fprintf(stderr, "EE %s:%d %s UVD - " fmt, __FILE__, __LINE__, __func__, ##args)
37 #define UVD_FW_1_66_16 ((1 << 24) | (66 << 16) | (16 << 8))
39 /* video buffer representation */
42 struct si_resource
*res
;
45 /* generate an stream handle */
46 unsigned si_vid_alloc_stream_handle(void);
48 /* create a buffer in the winsys */
49 bool si_vid_create_buffer(struct pipe_screen
*screen
, struct rvid_buffer
*buffer
, unsigned size
,
52 /* destroy a buffer */
53 void si_vid_destroy_buffer(struct rvid_buffer
*buffer
);
55 /* reallocate a buffer, preserving its content */
56 bool si_vid_resize_buffer(struct pipe_screen
*screen
, struct radeon_cmdbuf
*cs
,
57 struct rvid_buffer
*new_buf
, unsigned new_size
);
59 /* clear the buffer with zeros */
60 void si_vid_clear_buffer(struct pipe_context
*context
, struct rvid_buffer
*buffer
);
62 #endif // RADEON_VIDEO_H