2 * Copyright © 2012 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 * Xiang Haihao <haihao.xiang@intel.com>
27 #ifndef _I965_GPE_UTILS_H_
28 #define _I965_GPE_UTILS_H_
31 #include <intel_bufmgr.h>
33 #include "i965_defines.h"
34 #include "i965_drv_video.h"
35 #include "i965_structs.h"
37 #define MAX_GPE_KERNELS 32
39 struct i965_buffer_surface
42 unsigned int num_blocks;
43 unsigned int size_block;
47 struct i965_gpe_context
51 unsigned int length; /* in bytes */
52 } surface_state_binding_table;
56 unsigned int max_entries;
57 unsigned int entry_size; /* in bytes */
62 unsigned int length; /* in bytes */
66 unsigned int gpgpu_mode : 1;
67 unsigned int pad0 : 7;
68 unsigned int max_num_threads : 16;
69 unsigned int num_urb_entries : 8;
70 unsigned int urb_entry_size : 16;
71 unsigned int curbe_allocation_size : 16;
74 /* vfe_desc5/6/7 is used to determine whether the HW scoreboard is used.
75 * If scoreboard is not used, don't touch them
83 unsigned int enable:1;
115 unsigned int num_kernels;
116 struct i965_kernel kernels[MAX_GPE_KERNELS];
119 void i965_gpe_context_destroy(struct i965_gpe_context *gpe_context);
120 void i965_gpe_context_init(VADriverContextP ctx,
121 struct i965_gpe_context *gpe_context);
122 void i965_gpe_load_kernels(VADriverContextP ctx,
123 struct i965_gpe_context *gpe_context,
124 struct i965_kernel *kernel_list,
125 unsigned int num_kernels);
126 void gen6_gpe_pipeline_setup(VADriverContextP ctx,
127 struct i965_gpe_context *gpe_context,
128 struct intel_batchbuffer *batch);
129 void i965_gpe_surface2_setup(VADriverContextP ctx,
130 struct i965_gpe_context *gpe_context,
131 struct object_surface *obj_surface,
132 unsigned long binding_table_offset,
133 unsigned long surface_state_offset);
134 void i965_gpe_media_rw_surface_setup(VADriverContextP ctx,
135 struct i965_gpe_context *gpe_context,
136 struct object_surface *obj_surface,
137 unsigned long binding_table_offset,
138 unsigned long surface_state_offset);
139 void i965_gpe_buffer_suface_setup(VADriverContextP ctx,
140 struct i965_gpe_context *gpe_context,
141 struct i965_buffer_surface *buffer_surface,
142 unsigned long binding_table_offset,
143 unsigned long surface_state_offset);
144 void gen7_gpe_surface2_setup(VADriverContextP ctx,
145 struct i965_gpe_context *gpe_context,
146 struct object_surface *obj_surface,
147 unsigned long binding_table_offset,
148 unsigned long surface_state_offset);
149 void gen7_gpe_media_rw_surface_setup(VADriverContextP ctx,
150 struct i965_gpe_context *gpe_context,
151 struct object_surface *obj_surface,
152 unsigned long binding_table_offset,
153 unsigned long surface_state_offset);
154 void gen7_gpe_buffer_suface_setup(VADriverContextP ctx,
155 struct i965_gpe_context *gpe_context,
156 struct i965_buffer_surface *buffer_surface,
157 unsigned long binding_table_offset,
158 unsigned long surface_state_offset);
159 void gen75_gpe_media_chroma_surface_setup(VADriverContextP ctx,
160 struct i965_gpe_context *gpe_context,
161 struct object_surface *obj_surface,
162 unsigned long binding_table_offset,
163 unsigned long surface_state_offset);
164 #endif /* _I965_GPE_UTILS_H_ */