Split TV property creation into its own routine
[profile/ivi/libdrm.git] / linux-core / xgi_cmdlist.h
1 /****************************************************************************
2  * Copyright (C) 2003-2006 by XGI Technology, Taiwan.
3  *
4  * All Rights Reserved.
5  *
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 on the rights to use, copy, modify, merge,
10  * publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so,
12  * subject to 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
16  * portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
21  * XGI AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24  * DEALINGS IN THE SOFTWARE.
25  ***************************************************************************/
26
27 #ifndef _XGI_CMDLIST_H_
28 #define _XGI_CMDLIST_H_
29
30 struct xgi_cmdring_info {
31         /**
32          * Kernel space pointer to the base of the command ring.
33          */
34         u32 * ptr;
35
36         /**
37          * Size, in bytes, of the command ring.
38          */
39         unsigned int size;
40
41         /**
42          * Base address of the command ring from the hardware's PoV.
43          */
44         unsigned int ring_hw_base;
45
46         u32 * last_ptr;
47
48         /**
49          * Offset, in bytes, from the start of the ring to the next available
50          * location to store a command.
51          */
52         unsigned int ring_offset;
53 };
54
55 struct xgi_info;
56 extern int xgi_cmdlist_initialize(struct xgi_info * info, size_t size,
57         struct drm_file * filp);
58
59 extern int xgi_state_change(struct xgi_info * info, unsigned int to,
60         unsigned int from);
61
62 extern void xgi_cmdlist_cleanup(struct xgi_info * info);
63
64 extern void xgi_emit_irq(struct xgi_info * info);
65
66 #endif                          /* _XGI_CMDLIST_H_ */