• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**************************************************************************
2  *
3  * Copyright 2003 VMware, Inc.
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
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21  * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  *
26  **************************************************************************/
27 
28 #ifndef _INTEL_INIT_H_
29 #define _INTEL_INIT_H_
30 
31 #include <stdbool.h>
32 #include <sys/time.h>
33 #include "dri_util.h"
34 #include "intel_bufmgr.h"
35 #include "i915_drm.h"
36 #include "util/xmlconfig.h"
37 
38 struct intel_screen
39 {
40    int deviceID;
41    int gen;
42 
43    __DRIscreen *driScrnPriv;
44 
45    bool no_hw;
46 
47    bool hw_has_swizzling;
48 
49    bool no_vbo;
50    dri_bufmgr *bufmgr;
51 
52    /**
53    * Configuration cache with default values for all contexts
54    */
55    driOptionCache optionCache;
56 };
57 
58 /* These defines are to ensure that i915_dri's symbols don't conflict with
59  * i965's when linked together.
60  */
61 #define intel_region_alloc                  old_intel_region_alloc
62 #define intel_region_alloc_for_fd           old_intel_region_alloc_for_fd
63 #define intel_region_alloc_for_handle       old_intel_region_alloc_for_handle
64 #define intel_region_flink                  old_intel_region_flink
65 #define intel_region_get_aligned_offset     old_intel_region_get_aligned_offset
66 #define intel_region_get_tile_masks         old_intel_region_get_tile_masks
67 #define intel_region_reference              old_intel_region_reference
68 #define intel_region_release                old_intel_region_release
69 #define intel_bufferobj_buffer              old_intel_bufferobj_buffer
70 #define intel_bufferobj_source              old_intel_bufferobj_source
71 #define intelInitBufferObjectFuncs          old_intelInitBufferObjectFuncs
72 #define intel_upload_data                   old_intel_upload_data
73 #define intel_upload_finish                 old_intel_upload_finish
74 #define intel_batchbuffer_data              old_intel_batchbuffer_data
75 #define intel_batchbuffer_emit_mi_flush     old_intel_batchbuffer_emit_mi_flush
76 #define intel_batchbuffer_emit_reloc        old_intel_batchbuffer_emit_reloc
77 #define intel_batchbuffer_emit_reloc_fenced old_intel_batchbuffer_emit_reloc_fenced
78 #define _intel_batchbuffer_flush            old__intel_batchbuffer_flush
79 #define intel_batchbuffer_free              old_intel_batchbuffer_free
80 #define intel_batchbuffer_init              old_intel_batchbuffer_init
81 #define intelInitClearFuncs                 old_intelInitClearFuncs
82 #define intelInitExtensions                 old_intelInitExtensions
83 #define intel_miptree_copy_teximage         old_intel_miptree_copy_teximage
84 #define intel_miptree_create                old_intel_miptree_create
85 #define intel_miptree_create_for_bo         old_intel_miptree_create_for_bo
86 #define intel_miptree_create_for_dri2_buffer old_intel_miptree_create_for_dri2_buffer
87 #define intel_miptree_create_for_renderbuffer old_intel_miptree_create_for_renderbuffer
88 #define intel_miptree_create_layout         old_intel_miptree_create_layout
89 #define intel_miptree_get_dimensions_for_image old_intel_miptree_get_dimensions_for_image
90 #define intel_miptree_get_image_offset      old_intel_miptree_get_image_offset
91 #define intel_miptree_get_tile_offsets      old_intel_miptree_get_tile_offsets
92 #define intel_miptree_map                   old_intel_miptree_map
93 #define intel_miptree_map_raw               old_intel_miptree_map_raw
94 #define intel_miptree_match_image           old_intel_miptree_match_image
95 #define intel_miptree_reference             old_intel_miptree_reference
96 #define intel_miptree_release               old_intel_miptree_release
97 #define intel_miptree_set_image_offset      old_intel_miptree_set_image_offset
98 #define intel_miptree_set_level_info        old_intel_miptree_set_level_info
99 #define intel_miptree_unmap                 old_intel_miptree_unmap
100 #define intel_miptree_unmap_raw             old_intel_miptree_unmap_raw
101 #define i945_miptree_layout_2d              old_i945_miptree_layout_2d
102 #define intel_get_texture_alignment_unit    old_intel_get_texture_alignment_unit
103 #define intelInitTextureImageFuncs          old_intelInitTextureImageFuncs
104 #define intel_miptree_create_for_teximage   old_intel_miptree_create_for_teximage
105 #define intelSetTexBuffer                   old_intelSetTexBuffer
106 #define intelSetTexBuffer2                  old_intelSetTexBuffer2
107 #define intelInitTextureSubImageFuncs       old_intelInitTextureSubImageFuncs
108 #define intelInitTextureCopyImageFuncs      old_intelInitTextureCopyImageFuncs
109 #define intel_finalize_mipmap_tree          old_intel_finalize_mipmap_tree
110 #define intelInitTextureFuncs               old_intelInitTextureFuncs
111 #define intel_check_blit_fragment_ops       old_intel_check_blit_fragment_ops
112 #define intelInitPixelFuncs                 old_intelInitPixelFuncs
113 #define intelBitmap                         old_intelBitmap
114 #define intelCopyPixels                     old_intelCopyPixels
115 #define intelDrawPixels                     old_intelDrawPixels
116 #define intelReadPixels                     old_intelReadPixels
117 #define intel_check_front_buffer_rendering  old_intel_check_front_buffer_rendering
118 #define intelInitBufferFuncs                old_intelInitBufferFuncs
119 #define intelClearWithBlit                  old_intelClearWithBlit
120 #define intelEmitCopyBlit                   old_intelEmitCopyBlit
121 #define intelEmitImmediateColorExpandBlit   old_intelEmitImmediateColorExpandBlit
122 #define intel_emit_linear_blit              old_intel_emit_linear_blit
123 #define intel_miptree_blit                  old_intel_miptree_blit
124 #define i945_miptree_layout                 old_i945_miptree_layout
125 #define intel_init_texture_formats          old_intel_init_texture_formats
126 #define intelCalcViewport                   old_intelCalcViewport
127 #define INTEL_DEBUG                         old_INTEL_DEBUG
128 #define intelDestroyContext                 old_intelDestroyContext
129 #define intelFinish                         old_intelFinish
130 #define _intel_flush                        old__intel_flush
131 #define intel_flush_rendering_to_batch      old_intel_flush_rendering_to_batch
132 #define intelInitContext                    old_intelInitContext
133 #define intelInitDriverFunctions            old_intelInitDriverFunctions
134 #define intelMakeCurrent                    old_intelMakeCurrent
135 #define intel_prepare_render                old_intel_prepare_render
136 #define intelUnbindContext                  old_intelUnbindContext
137 #define intel_update_renderbuffers          old_intel_update_renderbuffers
138 #define aub_dump_bmp                        old_aub_dump_bmp
139 #define get_time                            old_get_time
140 #define intel_translate_blend_factor        old_intel_translate_blend_factor
141 #define intel_translate_compare_func        old_intel_translate_compare_func
142 #define intel_translate_logic_op            old_intel_translate_logic_op
143 #define intel_translate_shadow_compare_func old_intel_translate_shadow_compare_func
144 #define intel_translate_stencil_op          old_intel_translate_stencil_op
145 #define intel_init_syncobj_functions        old_intel_init_syncobj_functions
146 #define intelChooseRenderState              old_intelChooseRenderState
147 #define intelFallback                       old_intelFallback
148 #define intel_finish_vb                     old_intel_finish_vb
149 #define intel_flush_prim                    old_intel_flush_prim
150 #define intel_get_prim_space                old_intel_get_prim_space
151 #define intelInitTriFuncs                   old_intelInitTriFuncs
152 #define intel_set_prim                      old_intel_set_prim
153 #define intel_create_private_renderbuffer   old_intel_create_private_renderbuffer
154 #define intel_create_renderbuffer           old_intel_create_renderbuffer
155 #define intel_fbo_init                      old_intel_fbo_init
156 #define intel_get_rb_region                 old_intel_get_rb_region
157 #define intel_renderbuffer_set_draw_offset  old_intel_renderbuffer_set_draw_offset
158 #define intel_miptree_create_for_image_buffer old_intel_miptree_create_for_image_buffer
159 #define intelFenceExtension                 old_intelFenceExtension
160 
161 extern void intelDestroyContext(__DRIcontext * driContextPriv);
162 
163 extern GLboolean intelUnbindContext(__DRIcontext * driContextPriv);
164 
165 const __DRIextension **__driDriverGetExtensions_i915(void);
166 extern const __DRI2fenceExtension intelFenceExtension;
167 
168 extern GLboolean
169 intelMakeCurrent(__DRIcontext * driContextPriv,
170                  __DRIdrawable * driDrawPriv,
171                  __DRIdrawable * driReadPriv);
172 
173 double get_time(void);
174 void aub_dump_bmp(struct gl_context *ctx);
175 
176 #endif
177