1 /**************************************************************************
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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 TUNGSTEN GRAPHICS 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.
26 **************************************************************************/
32 #include "simple_list.h"
33 #include "extensions.h"
34 #include "framebuffer.h"
38 #include "swrast/swrast.h"
39 #include "swrast_setup/swrast_setup.h"
43 #include "tnl/t_pipeline.h"
44 #include "tnl/t_vertex.h"
46 #include "drivers/common/driverfuncs.h"
48 #include "intel_screen.h"
51 #include "i830_common.h"
53 #include "intel_tex.h"
54 #include "intel_span.h"
55 #include "intel_ioctl.h"
56 #include "intel_batchbuffer.h"
57 #include "intel_blit.h"
58 #include "intel_regions.h"
59 #include "intel_buffer_objects.h"
66 int INTEL_DEBUG
= (0);
69 #define need_GL_ARB_multisample
70 #define need_GL_ARB_point_parameters
71 #define need_GL_ARB_texture_compression
72 #define need_GL_ARB_vertex_buffer_object
73 #define need_GL_ARB_vertex_program
74 #define need_GL_ARB_window_pos
75 #define need_GL_ARB_occlusion_query
76 #define need_GL_EXT_blend_color
77 #define need_GL_EXT_blend_equation_separate
78 #define need_GL_EXT_blend_func_separate
79 #define need_GL_EXT_blend_minmax
80 #define need_GL_EXT_cull_vertex
81 #define need_GL_EXT_fog_coord
82 #define need_GL_EXT_multi_draw_arrays
83 #define need_GL_EXT_secondary_color
84 #define need_GL_VERSION_2_0
85 #define need_GL_ARB_shader_objects
86 #define need_GL_ARB_vertex_shader
88 #include "extension_helper.h"
94 /***************************************
95 * Mesa's Driver Functions
96 ***************************************/
98 #define DRIVER_VERSION "4.1.3002"
100 static const GLubyte
*intelGetString( GLcontext
*ctx
, GLenum name
)
102 const char * chipset
;
103 static char buffer
[128];
107 return (GLubyte
*)"Tungsten Graphics, Inc";
111 switch (intel_context(ctx
)->intelScreen
->deviceID
) {
112 case PCI_CHIP_I965_Q
:
113 chipset
= "Intel(R) 965Q";
115 case PCI_CHIP_I965_G
:
116 case PCI_CHIP_I965_G_1
:
117 chipset
= "Intel(R) 965G";
119 case PCI_CHIP_I946_GZ
:
120 chipset
= "Intel(R) 946GZ";
122 case PCI_CHIP_I965_GM
:
123 chipset
= "Intel(R) 965GM";
125 case PCI_CHIP_I965_GME
:
126 chipset
= "Intel(R) 965GME/GLE";
129 chipset
= "Unknown Intel Chipset";
132 (void) driGetRendererString( buffer
, chipset
, DRIVER_VERSION
, 0 );
133 return (GLubyte
*) buffer
;
142 * Extension strings exported by the intel driver.
145 * It appears that ARB_texture_env_crossbar has "disappeared" compared to the
146 * old i830-specific driver.
148 const struct dri_extension card_extensions
[] =
150 { "GL_ARB_multisample", GL_ARB_multisample_functions
},
151 { "GL_ARB_multitexture", NULL
},
152 { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions
},
153 { "GL_ARB_texture_border_clamp", NULL
},
154 { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions
},
155 { "GL_ARB_texture_cube_map", NULL
},
156 { "GL_ARB_texture_env_add", NULL
},
157 { "GL_ARB_texture_env_combine", NULL
},
158 { "GL_ARB_texture_env_dot3", NULL
},
159 { "GL_ARB_texture_mirrored_repeat", NULL
},
160 { "GL_ARB_texture_non_power_of_two", NULL
},
161 { "GL_ARB_texture_rectangle", NULL
},
162 { "GL_NV_texture_rectangle", NULL
},
163 { "GL_EXT_texture_rectangle", NULL
},
164 { "GL_ARB_texture_rectangle", NULL
},
165 { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions
},
166 { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions
},
167 { "GL_ARB_window_pos", GL_ARB_window_pos_functions
},
168 { "GL_EXT_blend_color", GL_EXT_blend_color_functions
},
169 { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions
},
170 { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions
},
171 { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions
},
172 { "GL_EXT_blend_logic_op", NULL
},
173 { "GL_EXT_blend_subtract", NULL
},
174 { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions
},
175 { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions
},
176 { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions
},
177 { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions
},
178 { "GL_EXT_stencil_wrap", NULL
},
179 { "GL_EXT_texture_edge_clamp", NULL
},
180 { "GL_EXT_texture_env_combine", NULL
},
181 { "GL_EXT_texture_env_dot3", NULL
},
182 { "GL_EXT_texture_filter_anisotropic", NULL
},
183 { "GL_EXT_texture_lod_bias", NULL
},
184 { "GL_3DFX_texture_compression_FXT1", NULL
},
185 { "GL_APPLE_client_storage", NULL
},
186 { "GL_MESA_pack_invert", NULL
},
187 { "GL_MESA_ycbcr_texture", NULL
},
188 { "GL_NV_blend_square", NULL
},
189 { "GL_SGIS_generate_mipmap", NULL
},
190 { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions
},
191 { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions
},
192 { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions
},
193 { "GL_ARB_fragment_shader", NULL
},
194 /* XXX not implement yet, to compile builtin glsl lib */
195 { "GL_ARB_draw_buffers", NULL
},
199 const struct dri_extension arb_oc_extension
=
200 { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions
};
202 void intelInitExtensions(GLcontext
*ctx
, GLboolean enable_imaging
)
204 struct intel_context
*intel
= ctx
?intel_context(ctx
):NULL
;
205 driInitExtensions(ctx
, card_extensions
, enable_imaging
);
206 if (!ctx
|| intel
->intelScreen
->drmMinor
>= 8)
207 driInitSingleExtension (ctx
, &arb_oc_extension
);
210 static const struct dri_debug_control debug_control
[] =
212 { "fall", DEBUG_FALLBACKS
},
213 { "tex", DEBUG_TEXTURE
},
214 { "ioctl", DEBUG_IOCTL
},
215 { "prim", DEBUG_PRIMS
},
216 { "vert", DEBUG_VERTS
},
217 { "state", DEBUG_STATE
},
218 { "verb", DEBUG_VERBOSE
},
219 { "dri", DEBUG_DRI
},
220 { "dma", DEBUG_DMA
},
221 { "san", DEBUG_SANITY
},
222 { "sync", DEBUG_SYNC
},
223 { "sleep", DEBUG_SLEEP
},
224 { "pix", DEBUG_PIXEL
},
225 { "buf", DEBUG_BUFMGR
},
226 { "stats", DEBUG_STATS
},
227 { "tile", DEBUG_TILE
},
228 { "sing", DEBUG_SINGLE_THREAD
},
229 { "thre", DEBUG_SINGLE_THREAD
},
236 static void intelInvalidateState( GLcontext
*ctx
, GLuint new_state
)
238 struct intel_context
*intel
= intel_context(ctx
);
240 _swrast_InvalidateState( ctx
, new_state
);
241 _swsetup_InvalidateState( ctx
, new_state
);
242 _vbo_InvalidateState( ctx
, new_state
);
243 _tnl_InvalidateState( ctx
, new_state
);
244 _tnl_invalidate_vertex_state( ctx
, new_state
);
246 intel
->NewGLState
|= new_state
;
248 if (intel
->vtbl
.invalidate_state
)
249 intel
->vtbl
.invalidate_state( intel
, new_state
);
253 void intelFlush( GLcontext
*ctx
)
255 struct intel_context
*intel
= intel_context( ctx
);
257 bmLockAndFence(intel
);
260 void intelFinish( GLcontext
*ctx
)
262 struct intel_context
*intel
= intel_context( ctx
);
264 bmFinishFence(intel
, bmLockAndFence(intel
));
268 intelBeginQuery(GLcontext
*ctx
, GLenum target
, struct gl_query_object
*q
)
270 struct intel_context
*intel
= intel_context( ctx
);
272 .read_write
= MMIO_READ
,
273 .reg
= MMIO_REGS_PS_DEPTH_COUNT
,
277 intelFinish(&intel
->ctx
);
278 drmCommandRead(intel
->driFd
, DRM_I830_MMIO
, &io
, sizeof(io
));
282 intelEndQuery(GLcontext
*ctx
, GLenum target
, struct gl_query_object
*q
)
284 struct intel_context
*intel
= intel_context( ctx
);
287 .read_write
= MMIO_READ
,
288 .reg
= MMIO_REGS_PS_DEPTH_COUNT
,
291 intelFinish(&intel
->ctx
);
292 drmCommandRead(intel
->driFd
, DRM_I830_MMIO
, &io
, sizeof(io
));
293 q
->Result
= tmp
- q
->Result
;
299 void intelInitDriverFunctions( struct dd_function_table
*functions
)
301 _mesa_init_driver_functions( functions
);
303 functions
->Flush
= intelFlush
;
304 functions
->Finish
= intelFinish
;
305 functions
->GetString
= intelGetString
;
306 functions
->UpdateState
= intelInvalidateState
;
307 functions
->BeginQuery
= intelBeginQuery
;
308 functions
->EndQuery
= intelEndQuery
;
310 /* CopyPixels can be accelerated even with the current memory
313 if (!getenv("INTEL_NO_BLIT")) {
314 functions
->CopyPixels
= intelCopyPixels
;
315 functions
->Bitmap
= intelBitmap
;
318 intelInitTextureFuncs( functions
);
319 intelInitStateFuncs( functions
);
320 intelInitBufferFuncs( functions
);
325 GLboolean
intelInitContext( struct intel_context
*intel
,
326 const __GLcontextModes
*mesaVis
,
327 __DRIcontextPrivate
*driContextPriv
,
328 void *sharedContextPrivate
,
329 struct dd_function_table
*functions
)
331 GLcontext
*ctx
= &intel
->ctx
;
332 GLcontext
*shareCtx
= (GLcontext
*) sharedContextPrivate
;
333 __DRIscreenPrivate
*sPriv
= driContextPriv
->driScreenPriv
;
334 intelScreenPrivate
*intelScreen
= (intelScreenPrivate
*)sPriv
->private;
335 volatile drmI830Sarea
*saPriv
= (volatile drmI830Sarea
*)
336 (((GLubyte
*)sPriv
->pSAREA
)+intelScreen
->sarea_priv_offset
);
338 if (!_mesa_initialize_context(&intel
->ctx
,
342 _mesa_printf("%s: failed to init mesa context\n", __FUNCTION__
);
346 driContextPriv
->driverPrivate
= intel
;
347 intel
->intelScreen
= intelScreen
;
348 intel
->driScreen
= sPriv
;
349 intel
->sarea
= saPriv
;
351 driParseConfigFiles (&intel
->optionCache
, &intelScreen
->optionCache
,
352 intel
->driScreen
->myNum
, "i965");
354 intel
->vblank_flags
= (intel
->intelScreen
->irq_active
!= 0)
355 ? driGetDefaultVBlankFlags(&intel
->optionCache
) : VBLANK_FLAG_NO_IRQ
;
357 ctx
->Const
.MaxTextureMaxAnisotropy
= 2.0;
359 if (getenv("INTEL_STRICT_CONFORMANCE")) {
360 intel
->strict_conformance
= 1;
363 if (intel
->strict_conformance
) {
364 ctx
->Const
.MinLineWidth
= 1.0;
365 ctx
->Const
.MinLineWidthAA
= 1.0;
366 ctx
->Const
.MaxLineWidth
= 1.0;
367 ctx
->Const
.MaxLineWidthAA
= 1.0;
368 ctx
->Const
.LineWidthGranularity
= 1.0;
371 ctx
->Const
.MinLineWidth
= 1.0;
372 ctx
->Const
.MinLineWidthAA
= 1.0;
373 ctx
->Const
.MaxLineWidth
= 5.0;
374 ctx
->Const
.MaxLineWidthAA
= 5.0;
375 ctx
->Const
.LineWidthGranularity
= 0.5;
378 ctx
->Const
.MinPointSize
= 1.0;
379 ctx
->Const
.MinPointSizeAA
= 1.0;
380 ctx
->Const
.MaxPointSize
= 255.0;
381 ctx
->Const
.MaxPointSizeAA
= 3.0;
382 ctx
->Const
.PointSizeGranularity
= 1.0;
384 /* reinitialize the context point state.
385 * It depend on constants in __GLcontextRec::Const
387 _mesa_init_point(ctx
);
389 /* Initialize the software rasterizer and helper modules. */
390 _swrast_CreateContext( ctx
);
391 _vbo_CreateContext( ctx
);
392 _tnl_CreateContext( ctx
);
393 _swsetup_CreateContext( ctx
);
395 TNL_CONTEXT(ctx
)->Driver
.RunPipeline
= _tnl_run_pipeline
;
397 /* Configure swrast to match hardware characteristics: */
398 _swrast_allow_pixel_fog( ctx
, GL_FALSE
);
399 _swrast_allow_vertex_fog( ctx
, GL_TRUE
);
402 intel
->hHWContext
= driContextPriv
->hHWContext
;
403 intel
->driFd
= sPriv
->fd
;
404 intel
->driHwLock
= (drmLock
*) &sPriv
->pSAREA
->lock
;
406 intel
->hw_stencil
= mesaVis
->stencilBits
&& mesaVis
->depthBits
== 24;
407 intel
->hw_stipple
= 1;
409 switch(mesaVis
->depthBits
) {
410 case 0: /* what to do in this case? */
412 intel
->depth_scale
= 1.0/0xffff;
413 intel
->polygon_offset_scale
= 1.0/0xffff;
414 intel
->depth_clear_mask
= ~0;
415 intel
->ClearDepth
= 0xffff;
418 intel
->depth_scale
= 1.0/0xffffff;
419 intel
->polygon_offset_scale
= 2.0/0xffffff; /* req'd to pass glean */
420 intel
->depth_clear_mask
= 0x00ffffff;
421 intel
->stencil_clear_mask
= 0xff000000;
422 intel
->ClearDepth
= 0x00ffffff;
429 /* Initialize swrast, tnl driver tables: */
430 intelInitSpanFuncs( ctx
);
432 intel
->no_hw
= getenv("INTEL_NO_HW") != NULL
;
434 if (!intel
->intelScreen
->irq_active
) {
435 _mesa_printf("IRQs not active. Exiting\n");
438 intelInitExtensions(ctx
, GL_TRUE
);
440 INTEL_DEBUG
= driParseDebugString( getenv( "INTEL_DEBUG" ),
446 intel
->bm
= bm_fake_intel_Attach( intel
);
450 intel
->intelScreen
->tex
.offset
, /* low offset */
451 intel
->intelScreen
->tex
.map
, /* low virtual */
452 intel
->intelScreen
->tex
.size
,
455 /* These are still static, but create regions for them.
457 intel
->front_region
=
458 intel_region_create_static(intel
,
460 intelScreen
->front
.offset
,
461 intelScreen
->front
.map
,
463 intelScreen
->front
.pitch
/ intelScreen
->cpp
,
465 intelScreen
->front
.size
,
466 intelScreen
->front
.tiled
!= 0);
469 intel_region_create_static(intel
,
471 intelScreen
->back
.offset
,
472 intelScreen
->back
.map
,
474 intelScreen
->back
.pitch
/ intelScreen
->cpp
,
476 intelScreen
->back
.size
,
477 intelScreen
->back
.tiled
!= 0);
479 /* Still assuming front.cpp == depth.cpp
481 * XXX: Setting tiling to false because Depth tiling only supports
482 * YMAJOR but the blitter only supports XMAJOR tiling. Have to
485 intel
->depth_region
=
486 intel_region_create_static(intel
,
488 intelScreen
->depth
.offset
,
489 intelScreen
->depth
.map
,
491 intelScreen
->depth
.pitch
/ intelScreen
->cpp
,
493 intelScreen
->depth
.size
,
494 intelScreen
->depth
.tiled
!= 0);
496 intel_bufferobj_init( intel
);
497 intel
->batch
= intel_batchbuffer_alloc( intel
);
499 if (intel
->ctx
.Mesa_DXTn
) {
500 _mesa_enable_extension( ctx
, "GL_EXT_texture_compression_s3tc" );
501 _mesa_enable_extension( ctx
, "GL_S3_s3tc" );
503 else if (driQueryOptionb (&intelScreen
->optionCache
, "force_s3tc_enable")) {
504 _mesa_enable_extension( ctx
, "GL_EXT_texture_compression_s3tc" );
507 /* driInitTextureObjects( ctx, & intel->swapped, */
508 /* DRI_TEXMGR_DO_TEXTURE_1D | */
509 /* DRI_TEXMGR_DO_TEXTURE_2D | */
510 /* DRI_TEXMGR_DO_TEXTURE_RECT ); */
513 if (getenv("INTEL_NO_RAST")) {
514 fprintf(stderr
, "disabling 3D rasterization\n");
522 void intelDestroyContext(__DRIcontextPrivate
*driContextPriv
)
524 struct intel_context
*intel
= (struct intel_context
*) driContextPriv
->driverPrivate
;
526 assert(intel
); /* should never be null */
528 GLboolean release_texture_heaps
;
531 intel
->vtbl
.destroy( intel
);
533 release_texture_heaps
= (intel
->ctx
.Shared
->RefCount
== 1);
534 _swsetup_DestroyContext (&intel
->ctx
);
535 _tnl_DestroyContext (&intel
->ctx
);
536 _vbo_DestroyContext (&intel
->ctx
);
538 _swrast_DestroyContext (&intel
->ctx
);
539 intel
->Fallback
= 0; /* don't call _swrast_Flush later */
540 intel_batchbuffer_free(intel
->batch
);
544 if ( release_texture_heaps
) {
545 /* This share group is about to go away, free our private
546 * texture object data.
549 /* XXX: destroy the shared bufmgr struct here?
553 /* Free the regions created to describe front/back/depth
557 intel_region_release(intel
, &intel
->front_region
);
558 intel_region_release(intel
, &intel
->back_region
);
559 intel_region_release(intel
, &intel
->depth_region
);
560 intel_region_release(intel
, &intel
->draw_region
);
563 /* free the Mesa context */
564 intel
->ctx
.VertexProgram
.Current
= NULL
;
565 intel
->ctx
.FragmentProgram
.Current
= NULL
;
566 _mesa_destroy_context(&intel
->ctx
);
569 driContextPriv
->driverPrivate
= NULL
;
572 GLboolean
intelUnbindContext(__DRIcontextPrivate
*driContextPriv
)
577 GLboolean
intelMakeCurrent(__DRIcontextPrivate
*driContextPriv
,
578 __DRIdrawablePrivate
*driDrawPriv
,
579 __DRIdrawablePrivate
*driReadPriv
)
582 if (driContextPriv
) {
583 struct intel_context
*intel
= (struct intel_context
*) driContextPriv
->driverPrivate
;
585 if ( intel
->driDrawable
!= driDrawPriv
) {
586 /* Shouldn't the readbuffer be stored also? */
587 driDrawableInitVBlank( driDrawPriv
, intel
->vblank_flags
,
590 intel
->driDrawable
= driDrawPriv
;
591 intelWindowMoved( intel
);
594 _mesa_make_current(&intel
->ctx
,
595 (GLframebuffer
*) driDrawPriv
->driverPrivate
,
596 (GLframebuffer
*) driReadPriv
->driverPrivate
);
598 intel
->ctx
.Driver
.DrawBuffer( &intel
->ctx
, intel
->ctx
.Color
.DrawBuffer
[0] );
600 _mesa_make_current(NULL
, NULL
, NULL
);
607 static void intelContendedLock( struct intel_context
*intel
, GLuint flags
)
609 __DRIdrawablePrivate
*dPriv
= intel
->driDrawable
;
610 __DRIscreenPrivate
*sPriv
= intel
->driScreen
;
611 volatile drmI830Sarea
* sarea
= intel
->sarea
;
612 int me
= intel
->hHWContext
;
613 int my_bufmgr
= bmCtxId(intel
);
615 drmGetLock(intel
->driFd
, intel
->hHWContext
, flags
);
617 /* If the window moved, may need to set a new cliprect now.
619 * NOTE: This releases and regains the hw lock, so all state
620 * checking must be done *after* this call:
623 DRI_VALIDATE_DRAWABLE_INFO(sPriv
, dPriv
);
627 intel
->need_flush
= 1;
631 if (sarea
->ctxOwner
!= me
) {
632 DBG("Lost Context: sarea->ctxOwner %x me %x\n", sarea
->ctxOwner
, me
);
633 sarea
->ctxOwner
= me
;
634 intel
->vtbl
.lost_hardware( intel
);
637 /* As above, but don't evict the texture data on transitions
638 * between contexts which all share a local buffer manager.
640 if (sarea
->texAge
!= my_bufmgr
) {
641 DBG("Lost Textures: sarea->texAge %x my_bufmgr %x\n", sarea
->ctxOwner
, my_bufmgr
);
642 sarea
->texAge
= my_bufmgr
;
643 bm_fake_NotifyContendedLockTake( intel
);
648 if (dPriv
&& intel
->lastStamp
!= dPriv
->lastStamp
) {
649 intelWindowMoved( intel
);
650 intel
->lastStamp
= dPriv
->lastStamp
;
654 _glthread_DECLARE_STATIC_MUTEX(lockMutex
);
656 /* Lock the hardware and validate our state.
658 void LOCK_HARDWARE( struct intel_context
*intel
)
662 _glthread_LOCK_MUTEX(lockMutex
);
663 assert(!intel
->locked
);
666 DRM_CAS(intel
->driHwLock
, intel
->hHWContext
,
667 (DRM_LOCK_HELD
|intel
->hHWContext
), __ret
);
669 intelContendedLock( intel
, 0 );
673 if (intel
->aub_wrap
) {
674 bm_fake_NotifyContendedLockTake( intel
);
675 intel
->vtbl
.lost_hardware( intel
);
676 intel
->vtbl
.aub_wrap(intel
);
680 if (bmError(intel
)) {
682 intel
->vtbl
.lost_hardware( intel
);
685 /* Make sure nothing has been emitted prior to getting the lock:
687 assert(intel
->batch
->map
== 0);
689 /* XXX: postpone, may not be needed:
691 if (!intel_batchbuffer_map(intel
->batch
)) {
693 intel
->vtbl
.lost_hardware( intel
);
695 /* This could only fail if the batchbuffer was greater in size
696 * than the available texture memory:
698 if (!intel_batchbuffer_map(intel
->batch
)) {
699 _mesa_printf("double failure to map batchbuffer\n");
706 /* Unlock the hardware using the global current context
708 void UNLOCK_HARDWARE( struct intel_context
*intel
)
710 /* Make sure everything has been released:
712 assert(intel
->batch
->ptr
== intel
->batch
->map
+ intel
->batch
->offset
);
714 intel_batchbuffer_unmap(intel
->batch
);
715 intel
->vtbl
.note_unlock( intel
);
720 DRM_UNLOCK(intel
->driFd
, intel
->driHwLock
, intel
->hHWContext
);
721 _glthread_UNLOCK_MUTEX(lockMutex
);