2 *-----------------------------------------------------------------------------
5 *-----------------------------------------------------------------------------
6 * Copyright (c) 2002-2010, Intel Corporation.
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
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 NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 *-----------------------------------------------------------------------------
29 *-----------------------------------------------------------------------------
32 #ifndef _HAL_PLB_CONTEXT_H
33 #define _HAL_PLB_CONTEXT_H
38 #include <igd_render.h>
40 #include <servicesint.h>
42 * FIXME: Promote io_mapped/io_base to DI layer
44 * Note: This define is for the vBIOS OAL only. Do not use
45 * it anywhere else, use the actual type name.
47 #define PLATFORM_CONTEXT_T platform_context_plb_t
49 typedef struct psb_use_reg {
50 unsigned long reg_seq;
53 unsigned long data_master;
57 typedef struct drmBO {
61 typedef struct psb_closed_dpm {
62 drmBO_t *page_table_bo;
63 drmBO_t *parameter_bo;
64 unsigned int num_pages;
65 unsigned int context_id;
66 unsigned int ta_global_list;
67 unsigned int ta_threshold;
68 unsigned int zls_threshold;
71 typedef struct _psb_sgx_priv {
73 /* HW workaround table */
74 /* ***********************************************/
75 struct pclosed_vopt vopt;
77 /* stuff required to be setup by sgx_init in cmd */
78 /* ***********************************************/
79 struct psb_use_reg use_code[SGX_MAX_USSE_THRDS];
80 igd_dma_t drm_bo[DRM_BO_MEM_TYPES];
88 unsigned long usse_reg_dm;
89 unsigned long num_use_attribute_registers;
91 psb_closed_dpm_t dpms[2];
92 /* What is an igd_command variable doing here?!
93 * should we move this into an appcontext_plb
94 * structure and let psb_sgx_priv_t have a ptr
95 * to the active appcontext_plb pointer? i.e. an
96 * appcontext created for 3d context?
98 igd_command_t context_select;
100 /* stuff required to be setup by sgx_init in gart */
101 /* ***********************************************/
102 unsigned int cache_ctrl;
104 /* state required to be setup by sgx_init in pwr */
105 /* ***********************************************/
108 /* Values used in platform_context_plb_t->flip_pending
109 * This corresponds to the pipe, which is a bit strange,
110 * but since the flip must wait for a vBlank, it is
111 * based off the PIPE */
112 #define PLB_FLIP_PIPE_A_PENDING 1
113 #define PLB_FLIP_PIPE_B_PENDING 2
115 typedef struct _tnc_topaz_priv {
117 /* current video task */
118 unsigned long topaz_cur_codec;
119 unsigned long cur_mtx_data_size;
120 int topaz_needs_reset;
121 int topaz_start_idle;
122 unsigned long topaz_idle_start_jiffies;
123 /* used by topaz_lockup */
124 unsigned long topaz_current_sequence;
125 unsigned long topaz_last_sequence;
126 unsigned long topaz_finished_sequence;
129 * topaz command queueu
131 int topaz_busy; /* 0 means topaz is free */
135 unsigned long topaz_ccb_buffer_addr;
136 unsigned long topaz_ccb_ctrl_addr;
137 unsigned long topaz_ccb_size;
138 unsigned long topaz_cmd_windex;
139 unsigned short topaz_cmd_seq;
141 unsigned long stored_initial_qp;
142 unsigned long topaz_frame_skip;
143 unsigned long topaz_dash_access_ctrl;
145 unsigned char *topaz_ccb_wb;
146 unsigned long topaz_wb_offset;
147 unsigned long *topaz_sync_addr;
148 unsigned long topaz_sync_offset;
149 unsigned long topaz_sync_cmd_seq;
150 unsigned long topaz_sync_id;
152 * Virtual address to writeback memory in the aperture space.
154 unsigned char *virt_wb;
156 * Offset in gmm space for write back memory.
158 unsigned long wb_offset;
161 struct msvdx_pvr_info;
163 typedef struct _platform_context_plb {
166 os_pci_dev_t pcidev0;
167 os_pci_dev_t pcidev1;
168 os_pci_dev_t lpc_dev;
169 os_pci_dev_t bridgedev;
170 unsigned char tnc_dev3_rid; /* TNC Device 3 RID*/
171 os_pci_dev_t stbridgedev;
172 os_pci_dev_t stgpiodev;
173 unsigned long rendec_base0;
174 unsigned long rendec_base1;
176 * Cached value of the SGX's PSB_CR_BIF_DIR_LIST_BASE1, which is
177 * used to configure MSVDX MMU base 0.
179 unsigned long psb_cr_bif_dir_list_base1;
180 int msvdx_needs_reset;
181 spinlock_t msvdx_lock;
182 spinlock_t msvdx_init_plb;
183 unsigned long msvdx_status;
185 struct list_head msvdx_queue;
186 unsigned long msvdx_dash_access_ctrl;
187 struct msvdx_pvr_info *msvdx_pvr;
188 psb_sgx_priv_t sgx_priv_data;
189 tnc_topaz_priv_t tpz_private_data;
190 unsigned long msvdx_fence;
192 unsigned long src_pat_data_offset;
193 unsigned long glyph_data_offset;
194 unsigned long sequence;
195 unsigned long mtx_submitted;
196 unsigned long mtx_completed;
197 unsigned long mtx_buf_size;
198 unsigned long host_buf_size;
199 unsigned long mtx_buf_offset;
200 unsigned long host_buf_offset;
201 /* Flip pending. This is used in the mode
202 * module, but it is intialized in the cmd
203 * module along with the other mutex-es */
204 unsigned int flip_pending;
205 os_pthread_mutex_t flip_mutex;
208 } platform_context_plb_t, platform_context_tnc_t;