Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
drm
ttm
ttm_object.h
Go to the documentation of this file.
1
/**************************************************************************
2
*
3
* Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
4
* All Rights Reserved.
5
*
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:
13
*
14
* The above copyright notice and this permission notice (including the
15
* next paragraph) shall be included in all copies or substantial portions
16
* of the Software.
17
*
18
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24
* USE OR OTHER DEALINGS IN THE SOFTWARE.
25
*
26
**************************************************************************/
27
/*
28
* Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
29
*/
37
#ifndef _TTM_OBJECT_H_
38
#define _TTM_OBJECT_H_
39
40
#include <linux/list.h>
41
#include <
drm/drm_hashtab.h
>
42
#include <
linux/kref.h
>
43
#include <
ttm/ttm_memory.h
>
44
60
enum
ttm_ref_type
{
61
TTM_REF_USAGE
,
62
TTM_REF_SYNCCPU_READ
,
63
TTM_REF_SYNCCPU_WRITE
,
64
TTM_REF_NUM
65
};
66
75
enum
ttm_object_type
{
76
ttm_fence_type
,
77
ttm_buffer_type
,
78
ttm_lock_type
,
79
ttm_driver_type0
= 256,
80
ttm_driver_type1
,
81
ttm_driver_type2
,
82
ttm_driver_type3
,
83
ttm_driver_type4
,
84
ttm_driver_type5
85
};
86
87
struct
ttm_object_file
;
88
struct
ttm_object_device
;
89
122
struct
ttm_base_object
{
123
struct
drm_hash_item
hash
;
124
enum
ttm_object_type
object_type
;
125
bool
shareable
;
126
struct
ttm_object_file
*
tfile
;
127
struct
kref
refcount
;
128
void
(*
refcount_release
) (
struct
ttm_base_object
**
base
);
129
void
(*
ref_obj_release
) (
struct
ttm_base_object
*
base
,
130
enum
ttm_ref_type
ref_type);
131
};
132
147
extern
int
ttm_base_object_init
(
struct
ttm_object_file
*
tfile
,
148
struct
ttm_base_object
*base,
149
bool
shareable
,
150
enum
ttm_object_type
type
,
151
void
(*
refcount_release
) (
struct
ttm_base_object
152
**),
153
void
(*
ref_obj_release
) (
struct
ttm_base_object
154
*,
155
enum
ttm_ref_type
156
ref_type));
157
169
extern
struct
ttm_base_object
*
ttm_base_object_lookup
(
struct
ttm_object_file
170
*tfile,
uint32_t
key
);
171
181
extern
void
ttm_base_object_unref
(
struct
ttm_base_object
**p_base);
182
202
extern
int
ttm_ref_object_add
(
struct
ttm_object_file
*tfile,
203
struct
ttm_base_object
*base,
204
enum
ttm_ref_type
ref_type,
bool
*existed);
216
extern
int
ttm_ref_object_base_unref
(
struct
ttm_object_file
*tfile,
217
unsigned
long
key
,
218
enum
ttm_ref_type
ref_type);
219
229
extern
struct
ttm_object_file
*
ttm_object_file_init
(
struct
ttm_object_device
230
*
tdev
,
231
unsigned
int
hash_order);
232
244
extern
void
ttm_object_file_release
(
struct
ttm_object_file
**p_tfile);
245
255
extern
struct
ttm_object_device
*
ttm_object_device_init
256
(
struct
ttm_mem_global
*
mem_glob
,
unsigned
int
hash_order);
257
269
extern
void
ttm_object_device_release
(
struct
ttm_object_device
**p_tdev);
270
271
#endif
Generated on Thu Jan 10 2013 14:51:00 for Linux Kernel by
1.8.2