2 * Copyright © 2008 Jérôme Glisse
3 * Copyright © 2011 Marek Olšák <maraeo@gmail.com>
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a 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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
18 * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
23 * The above copyright notice and this permission notice (including the
24 * next paragraph) shall be included in all copies or substantial portions
29 * Jérôme Glisse <glisse@freedesktop.org>
30 * Marek Olšák <maraeo@gmail.com>
32 #ifndef RADEON_DRM_BO_H
33 #define RADEON_DRM_BO_H
35 #include "radeon_drm_winsys.h"
36 #include "pipebuffer/pb_bufmgr.h"
37 #include "os/os_thread.h"
41 struct radeon_bo_desc
{
44 unsigned initial_domains
;
48 struct pb_buffer base
;
50 struct radeon_bomgr
*mgr
;
51 struct radeon_drm_winsys
*rws
;
59 enum radeon_bo_domain initial_domain
;
61 /* how many command streams is this bo referenced in? */
62 int num_cs_references
;
64 /* how many command streams, which are being emitted in a separate
65 * thread, is this bo referenced in? */
66 int num_active_ioctls
;
72 struct pb_manager
*radeon_bomgr_create(struct radeon_drm_winsys
*rws
);
73 void radeon_bomgr_init_functions(struct radeon_drm_winsys
*ws
);
76 void radeon_bo_reference(struct radeon_bo
**dst
, struct radeon_bo
*src
)
78 pb_reference((struct pb_buffer
**)dst
, (struct pb_buffer
*)src
);
81 void *radeon_bo_do_map(struct radeon_bo
*bo
);