Ps3GpuTransferData cannot handle negative X and Y copy directions, fallback to softwa...
[ps3freebsd_xf86_video_ps3gpu.git] / src / ps3gpu_ctl.h
blobb8aba38b2b5d524fd0f29414feabf60bf7e1daeb
1 /*-
2 * Copyright (C) 2011 glevand <geoffrey.levand@mail.ru>
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer,
10 * without modification, immediately at the beginning of the file.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 * $FreeBSD$
29 #ifndef _PS3GPU_CTL_H
30 #define _PS3GPU_CTL_H
32 struct ps3gpu_ctl_context_allocate {
33 /* in */
34 int vram_size;
35 /* out */
36 int context_id;
37 unsigned long control_handle;
38 int control_size;
39 unsigned long driver_info_handle;
40 int driver_info_size;
41 unsigned long reports_handle;
42 int reports_size;
45 struct ps3gpu_ctl_context_free {
46 /* in */
47 int context_id;
50 enum ps3gpu_ctl_memory_type {
51 PS3GPU_CTL_MEMORY_TYPE_VIDEO,
52 PS3GPU_CTL_MEMORY_TYPE_GART
55 struct ps3gpu_ctl_memory_allocate {
56 /* in */
57 int context_id;
58 int type;
59 int size;
60 int align;
61 /* out */
62 unsigned long handle;
63 unsigned int gpu_addr;
66 struct ps3gpu_ctl_memory_free {
67 /* in */
68 int context_id;
69 unsigned long handle;
72 struct ps3gpu_ctl_setup_control {
73 /* in */
74 int context_id;
75 unsigned long put;
76 unsigned long get;
77 unsigned int ref;
80 enum ps3gpu_ctl_head {
81 PS3GPU_CTL_HEAD_A,
82 PS3GPU_CTL_HEAD_B
85 enum ps3gpu_ctl_flip_mode {
86 PS3GPU_CTL_FLIP_MODE_HSYNC,
87 PS3GPU_CTL_FLIP_MODE_VSYNC
90 struct ps3gpu_ctl_set_flip_mode {
91 /* in */
92 int context_id;
93 int head;
94 int mode;
97 struct ps3gpu_ctl_reset_flip_status {
98 /* in */
99 int context_id;
100 int head;
103 struct ps3gpu_ctl_flip {
104 /* in */
105 int context_id;
106 int head;
107 unsigned long offset;
110 struct ps3gpu_ctl_display_buffer_set {
111 /* in */
112 int context_id;
113 int buffer_id;
114 int width;
115 int height;
116 int pitch;
117 unsigned long offset;
120 struct ps3gpu_ctl_display_buffer_unset {
121 /* in */
122 int context_id;
123 int buffer_id;
126 struct ps3gpu_ctl_display_buffer_flip {
127 /* in */
128 int context_id;
129 int head;
130 int buffer_id;
133 struct ps3gpu_ctl_cursor_initialize {
134 /* in */
135 int context_id;
136 int head;
139 struct ps3gpu_ctl_cursor_set_image {
140 /* in */
141 int context_id;
142 int head;
143 unsigned long offset;
146 struct ps3gpu_ctl_cursor_set_position {
147 /* in */
148 int context_id;
149 int head;
150 int x;
151 int y;
154 struct ps3gpu_ctl_cursor_enable {
155 /* in */
156 int context_id;
157 int head;
158 int enable;
161 #define PS3GPU_CTL_CONTEXT_ALLOCATE _IOWR('G', 0, struct ps3gpu_ctl_context_allocate)
162 #define PS3GPU_CTL_CONTEXT_FREE _IOW('G', 1, struct ps3gpu_ctl_context_free)
163 #define PS3GPU_CTL_MEMORY_ALLOCATE _IOWR('G', 2, struct ps3gpu_ctl_memory_allocate)
164 #define PS3GPU_CTL_MEMORY_FREE _IOW('G', 3, struct ps3gpu_ctl_memory_free)
165 #define PS3GPU_CTL_SETUP_CONTROL _IOW('G', 4, struct ps3gpu_ctl_setup_control)
166 #define PS3GPU_CTL_SET_FLIP_MODE _IOW('G', 5, struct ps3gpu_ctl_set_flip_mode)
167 #define PS3GPU_CTL_RESET_FLIP_STATUS _IOW('G', 6, struct ps3gpu_ctl_reset_flip_status)
168 #define PS3GPU_CTL_FLIP _IOW('G', 7, struct ps3gpu_ctl_flip)
169 #define PS3GPU_CTL_DISPLAY_BUFFER_SET _IOW('G', 8, struct ps3gpu_ctl_display_buffer_set)
170 #define PS3GPU_CTL_DISPLAY_BUFFER_UNSET _IOW('G', 9, struct ps3gpu_ctl_display_buffer_unset)
171 #define PS3GPU_CTL_DISPLAY_BUFFER_FLIP _IOW('G', 10, struct ps3gpu_ctl_display_buffer_flip)
172 #define PS3GPU_CTL_CURSOR_INITIALIZE _IOW('G', 11, struct ps3gpu_ctl_cursor_initialize)
173 #define PS3GPU_CTL_CURSOR_SET_IMAGE _IOW('G', 12, struct ps3gpu_ctl_cursor_set_image)
174 #define PS3GPU_CTL_CURSOR_SET_POSITION _IOW('G', 13, struct ps3gpu_ctl_cursor_set_position)
175 #define PS3GPU_CTL_CURSOR_ENABLE _IOW('G', 14, struct ps3gpu_ctl_cursor_enable)
177 #endif /* _PS3GPU_CTL_H */