1) Add a new flag in the sarea (coopting the unused texAge value) to
[mesa.git] / src / mesa / drivers / dri / i965 / intel_context.c
1 /**************************************************************************
2 *
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
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 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.
25 *
26 **************************************************************************/
27
28
29 #include "glheader.h"
30 #include "context.h"
31 #include "matrix.h"
32 #include "simple_list.h"
33 #include "extensions.h"
34 #include "framebuffer.h"
35 #include "imports.h"
36
37 #include "swrast/swrast.h"
38 #include "swrast_setup/swrast_setup.h"
39 #include "tnl/tnl.h"
40 #include "array_cache/acache.h"
41
42 #include "tnl/t_pipeline.h"
43 #include "tnl/t_vertex.h"
44
45 #include "drivers/common/driverfuncs.h"
46
47 #include "intel_screen.h"
48
49 #include "i830_dri.h"
50 #include "i830_common.h"
51
52 #include "intel_tex.h"
53 #include "intel_span.h"
54 #include "intel_ioctl.h"
55 #include "intel_batchbuffer.h"
56 #include "intel_blit.h"
57 #include "intel_regions.h"
58 #include "intel_buffer_objects.h"
59
60 #include "bufmgr.h"
61
62 #include "utils.h"
63 #ifndef INTEL_DEBUG
64 int INTEL_DEBUG = (0);
65 #endif
66
67 #define need_GL_ARB_multisample
68 #define need_GL_ARB_point_parameters
69 #define need_GL_ARB_texture_compression
70 #define need_GL_ARB_vertex_buffer_object
71 #define need_GL_ARB_vertex_program
72 #define need_GL_ARB_window_pos
73 #define need_GL_EXT_blend_color
74 #define need_GL_EXT_blend_equation_separate
75 #define need_GL_EXT_blend_func_separate
76 #define need_GL_EXT_blend_minmax
77 #define need_GL_EXT_cull_vertex
78 #define need_GL_EXT_fog_coord
79 #define need_GL_EXT_multi_draw_arrays
80 #define need_GL_EXT_secondary_color
81 #include "extension_helper.h"
82
83 #ifndef VERBOSE
84 int VERBOSE = 0;
85 #endif
86
87 #if DEBUG_LOCKING
88 char *prevLockFile;
89 int prevLockLine;
90 #endif
91
92 /***************************************
93 * Mesa's Driver Functions
94 ***************************************/
95
96 #define DRIVER_VERSION "4.1.3002"
97
98 static const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
99 {
100 const char * chipset;
101 static char buffer[128];
102
103 switch (name) {
104 case GL_VENDOR:
105 return (GLubyte *)"Tungsten Graphics, Inc";
106 break;
107
108 case GL_RENDERER:
109 switch (intel_context(ctx)->intelScreen->deviceID) {
110 case PCI_CHIP_I965_Q:
111 chipset = "Intel(R) 965Q"; break;
112 break;
113 case PCI_CHIP_I965_G:
114 case PCI_CHIP_I965_G_1:
115 chipset = "Intel(R) 965G"; break;
116 break;
117 case PCI_CHIP_I946_GZ:
118 chipset = "Intel(R) 946GZ"; break;
119 break;
120 default:
121 chipset = "Unknown Intel Chipset"; break;
122 }
123
124 (void) driGetRendererString( buffer, chipset, DRIVER_VERSION, 0 );
125 return (GLubyte *) buffer;
126
127 default:
128 return NULL;
129 }
130 }
131
132
133 /**
134 * Extension strings exported by the intel driver.
135 *
136 * \note
137 * It appears that ARB_texture_env_crossbar has "disappeared" compared to the
138 * old i830-specific driver.
139 */
140 const struct dri_extension card_extensions[] =
141 {
142 { "GL_ARB_multisample", GL_ARB_multisample_functions },
143 { "GL_ARB_multitexture", NULL },
144 { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
145 { "GL_ARB_texture_border_clamp", NULL },
146 { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
147 { "GL_ARB_texture_cube_map", NULL },
148 { "GL_ARB_texture_env_add", NULL },
149 { "GL_ARB_texture_env_combine", NULL },
150 { "GL_ARB_texture_env_dot3", NULL },
151 { "GL_ARB_texture_mirrored_repeat", NULL },
152 { "GL_ARB_texture_rectangle", NULL },
153 { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
154 { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
155 { "GL_ARB_window_pos", GL_ARB_window_pos_functions },
156 { "GL_EXT_blend_color", GL_EXT_blend_color_functions },
157 { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
158 { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
159 { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
160 { "GL_EXT_blend_logic_op", NULL },
161 { "GL_EXT_blend_subtract", NULL },
162 { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions },
163 { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
164 { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
165 { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
166 { "GL_EXT_stencil_wrap", NULL },
167 { "GL_EXT_texture_edge_clamp", NULL },
168 { "GL_EXT_texture_env_combine", NULL },
169 { "GL_EXT_texture_env_dot3", NULL },
170 { "GL_EXT_texture_filter_anisotropic", NULL },
171 { "GL_EXT_texture_lod_bias", NULL },
172 { "GL_3DFX_texture_compression_FXT1", NULL },
173 { "GL_APPLE_client_storage", NULL },
174 { "GL_MESA_pack_invert", NULL },
175 { "GL_MESA_ycbcr_texture", NULL },
176 { "GL_NV_blend_square", NULL },
177 { "GL_SGIS_generate_mipmap", NULL },
178 { NULL, NULL }
179 };
180
181
182
183 static const struct dri_debug_control debug_control[] =
184 {
185 { "fall", DEBUG_FALLBACKS },
186 { "tex", DEBUG_TEXTURE },
187 { "ioctl", DEBUG_IOCTL },
188 { "prim", DEBUG_PRIMS },
189 { "vert", DEBUG_VERTS },
190 { "state", DEBUG_STATE },
191 { "verb", DEBUG_VERBOSE },
192 { "dri", DEBUG_DRI },
193 { "dma", DEBUG_DMA },
194 { "san", DEBUG_SANITY },
195 { "sync", DEBUG_SYNC },
196 { "sleep", DEBUG_SLEEP },
197 { "pix", DEBUG_PIXEL },
198 { "buf", DEBUG_BUFMGR },
199 { "stats", DEBUG_STATS },
200 { "tile", DEBUG_TILE },
201 { "sing", DEBUG_SINGLE_THREAD },
202 { "thre", DEBUG_SINGLE_THREAD },
203 { "wm", DEBUG_WM },
204 { "vs", DEBUG_VS },
205 { NULL, 0 }
206 };
207
208
209 static void intelInvalidateState( GLcontext *ctx, GLuint new_state )
210 {
211 struct intel_context *intel = intel_context(ctx);
212
213 _swrast_InvalidateState( ctx, new_state );
214 _swsetup_InvalidateState( ctx, new_state );
215 _ac_InvalidateState( ctx, new_state );
216 _tnl_InvalidateState( ctx, new_state );
217 _tnl_invalidate_vertex_state( ctx, new_state );
218
219 intel->NewGLState |= new_state;
220
221 if (intel->vtbl.invalidate_state)
222 intel->vtbl.invalidate_state( intel, new_state );
223 }
224
225
226 void intelFlush( GLcontext *ctx )
227 {
228 struct intel_context *intel = intel_context( ctx );
229
230 bmLockAndFence(intel);
231 }
232
233 void intelFinish( GLcontext *ctx )
234 {
235 struct intel_context *intel = intel_context( ctx );
236
237 bmFinishFence(intel, bmLockAndFence(intel));
238 }
239
240
241 void intelInitDriverFunctions( struct dd_function_table *functions )
242 {
243 _mesa_init_driver_functions( functions );
244
245 functions->Flush = intelFlush;
246 functions->Finish = intelFinish;
247 functions->GetString = intelGetString;
248 functions->UpdateState = intelInvalidateState;
249 functions->CopyColorTable = _swrast_CopyColorTable;
250 functions->CopyColorSubTable = _swrast_CopyColorSubTable;
251 functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
252 functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
253
254 /* Pixel path fallbacks.
255 */
256 functions->Accum = _swrast_Accum;
257 functions->Bitmap = _swrast_Bitmap;
258 functions->ReadPixels = _swrast_ReadPixels;
259 functions->DrawPixels = _swrast_DrawPixels;
260
261 /* CopyPixels can be accelerated even with the current memory
262 * manager:
263 */
264 functions->CopyPixels = intelCopyPixels;
265
266 intelInitTextureFuncs( functions );
267 intelInitStateFuncs( functions );
268 intelInitBufferFuncs( functions );
269 }
270
271
272
273 GLboolean intelInitContext( struct intel_context *intel,
274 const __GLcontextModes *mesaVis,
275 __DRIcontextPrivate *driContextPriv,
276 void *sharedContextPrivate,
277 struct dd_function_table *functions )
278 {
279 GLcontext *ctx = &intel->ctx;
280 GLcontext *shareCtx = (GLcontext *) sharedContextPrivate;
281 __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
282 intelScreenPrivate *intelScreen = (intelScreenPrivate *)sPriv->private;
283 volatile drmI830Sarea *saPriv = (volatile drmI830Sarea *)
284 (((GLubyte *)sPriv->pSAREA)+intelScreen->sarea_priv_offset);
285
286 if (!_mesa_initialize_context(&intel->ctx,
287 mesaVis, shareCtx,
288 functions,
289 (void*) intel)) {
290 _mesa_printf("%s: failed to init mesa context\n", __FUNCTION__);
291 return GL_FALSE;
292 }
293
294 driContextPriv->driverPrivate = intel;
295 intel->intelScreen = intelScreen;
296 intel->driScreen = sPriv;
297 intel->sarea = saPriv;
298
299
300 ctx->Const.MaxTextureMaxAnisotropy = 2.0;
301
302 if (getenv("INTEL_STRICT_CONFORMANCE")) {
303 intel->strict_conformance = 1;
304 }
305
306 if (intel->strict_conformance) {
307 ctx->Const.MinLineWidth = 1.0;
308 ctx->Const.MinLineWidthAA = 1.0;
309 ctx->Const.MaxLineWidth = 1.0;
310 ctx->Const.MaxLineWidthAA = 1.0;
311 ctx->Const.LineWidthGranularity = 1.0;
312 }
313 else {
314 ctx->Const.MinLineWidth = 1.0;
315 ctx->Const.MinLineWidthAA = 1.0;
316 ctx->Const.MaxLineWidth = 5.0;
317 ctx->Const.MaxLineWidthAA = 5.0;
318 ctx->Const.LineWidthGranularity = 0.5;
319 }
320
321 ctx->Const.MinPointSize = 1.0;
322 ctx->Const.MinPointSizeAA = 1.0;
323 ctx->Const.MaxPointSize = 255.0;
324 ctx->Const.MaxPointSizeAA = 3.0;
325 ctx->Const.PointSizeGranularity = 1.0;
326
327 /* Initialize the software rasterizer and helper modules. */
328 _swrast_CreateContext( ctx );
329 _ac_CreateContext( ctx );
330 _tnl_CreateContext( ctx );
331 _swsetup_CreateContext( ctx );
332
333 TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
334
335 /* Configure swrast to match hardware characteristics: */
336 _swrast_allow_pixel_fog( ctx, GL_FALSE );
337 _swrast_allow_vertex_fog( ctx, GL_TRUE );
338
339 /* Dri stuff */
340 intel->hHWContext = driContextPriv->hHWContext;
341 intel->driFd = sPriv->fd;
342 intel->driHwLock = (drmLock *) &sPriv->pSAREA->lock;
343
344 intel->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
345 intel->hw_stipple = 1;
346
347 switch(mesaVis->depthBits) {
348 case 0: /* what to do in this case? */
349 case 16:
350 intel->depth_scale = 1.0/0xffff;
351 intel->polygon_offset_scale = 1.0/0xffff;
352 intel->depth_clear_mask = ~0;
353 intel->ClearDepth = 0xffff;
354 break;
355 case 24:
356 intel->depth_scale = 1.0/0xffffff;
357 intel->polygon_offset_scale = 2.0/0xffffff; /* req'd to pass glean */
358 intel->depth_clear_mask = 0x00ffffff;
359 intel->stencil_clear_mask = 0xff000000;
360 intel->ClearDepth = 0x00ffffff;
361 break;
362 default:
363 assert(0);
364 break;
365 }
366
367 /* Initialize swrast, tnl driver tables: */
368 intelInitSpanFuncs( ctx );
369
370 intel->no_hw = getenv("INTEL_NO_HW") != NULL;
371
372 if (!intel->intelScreen->irq_active) {
373 _mesa_printf("IRQs not active. Exiting\n");
374 exit(1);
375 }
376
377 _math_matrix_ctr (&intel->ViewportMatrix);
378
379 driInitExtensions( ctx, card_extensions,
380 GL_TRUE );
381
382 INTEL_DEBUG = driParseDebugString( getenv( "INTEL_DEBUG" ),
383 debug_control );
384
385
386 /* Buffer manager:
387 */
388 intel->bm = bm_fake_intel_Attach( intel );
389
390
391 bmInitPool(intel,
392 intel->intelScreen->tex.offset, /* low offset */
393 intel->intelScreen->tex.map, /* low virtual */
394 intel->intelScreen->tex.size,
395 BM_MEM_AGP);
396
397 /* These are still static, but create regions for them.
398 */
399 intel->front_region =
400 intel_region_create_static(intel,
401 BM_MEM_AGP,
402 intelScreen->front.offset,
403 intelScreen->front.map,
404 intelScreen->cpp,
405 intelScreen->front.pitch / intelScreen->cpp,
406 intelScreen->height,
407 GL_FALSE);
408
409
410 intel->back_region =
411 intel_region_create_static(intel,
412 BM_MEM_AGP,
413 intelScreen->back.offset,
414 intelScreen->back.map,
415 intelScreen->cpp,
416 intelScreen->back.pitch / intelScreen->cpp,
417 intelScreen->height,
418 (INTEL_DEBUG & DEBUG_TILE) ? 0 : 1);
419
420 /* Still assuming front.cpp == depth.cpp
421 *
422 * XXX: Setting tiling to false because Depth tiling only supports
423 * YMAJOR but the blitter only supports XMAJOR tiling. Have to
424 * resolve later.
425 */
426 intel->depth_region =
427 intel_region_create_static(intel,
428 BM_MEM_AGP,
429 intelScreen->depth.offset,
430 intelScreen->depth.map,
431 intelScreen->cpp,
432 intelScreen->depth.pitch / intelScreen->cpp,
433 intelScreen->height,
434 (INTEL_DEBUG & DEBUG_TILE) ? 0 : 1);
435
436 intel_bufferobj_init( intel );
437 intel->batch = intel_batchbuffer_alloc( intel );
438
439 if (intel->ctx.Mesa_DXTn) {
440 _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
441 _mesa_enable_extension( ctx, "GL_S3_s3tc" );
442 }
443 else if (driQueryOptionb (&intelScreen->optionCache, "force_s3tc_enable")) {
444 _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
445 }
446
447 /* driInitTextureObjects( ctx, & intel->swapped, */
448 /* DRI_TEXMGR_DO_TEXTURE_1D | */
449 /* DRI_TEXMGR_DO_TEXTURE_2D | */
450 /* DRI_TEXMGR_DO_TEXTURE_RECT ); */
451
452
453 if (getenv("INTEL_NO_RAST")) {
454 fprintf(stderr, "disabling 3D rasterization\n");
455 intel->no_rast = 1;
456 }
457
458
459 return GL_TRUE;
460 }
461
462 void intelDestroyContext(__DRIcontextPrivate *driContextPriv)
463 {
464 struct intel_context *intel = (struct intel_context *) driContextPriv->driverPrivate;
465
466 assert(intel); /* should never be null */
467 if (intel) {
468 GLboolean release_texture_heaps;
469
470
471 intel->vtbl.destroy( intel );
472
473 release_texture_heaps = (intel->ctx.Shared->RefCount == 1);
474 _swsetup_DestroyContext (&intel->ctx);
475 _tnl_DestroyContext (&intel->ctx);
476 _ac_DestroyContext (&intel->ctx);
477
478 _swrast_DestroyContext (&intel->ctx);
479 intel->Fallback = 0; /* don't call _swrast_Flush later */
480 intel_batchbuffer_free(intel->batch);
481 intel->batch = NULL;
482
483
484 if ( release_texture_heaps ) {
485 /* This share group is about to go away, free our private
486 * texture object data.
487 */
488
489 /* XXX: destroy the shared bufmgr struct here?
490 */
491 }
492
493 /* Free the regions created to describe front/back/depth
494 * buffers:
495 */
496 #if 0
497 intel_region_release(intel, &intel->front_region);
498 intel_region_release(intel, &intel->back_region);
499 intel_region_release(intel, &intel->depth_region);
500 intel_region_release(intel, &intel->draw_region);
501 #endif
502
503 /* free the Mesa context */
504 _mesa_destroy_context(&intel->ctx);
505 }
506
507 driContextPriv->driverPrivate = NULL;
508 }
509
510 GLboolean intelUnbindContext(__DRIcontextPrivate *driContextPriv)
511 {
512 return GL_TRUE;
513 }
514
515 GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
516 __DRIdrawablePrivate *driDrawPriv,
517 __DRIdrawablePrivate *driReadPriv)
518 {
519
520 if (driContextPriv) {
521 struct intel_context *intel = (struct intel_context *) driContextPriv->driverPrivate;
522
523 if ( intel->driDrawable != driDrawPriv ) {
524 /* Shouldn't the readbuffer be stored also? */
525 intel->driDrawable = driDrawPriv;
526 intelWindowMoved( intel );
527 }
528
529 _mesa_make_current(&intel->ctx,
530 (GLframebuffer *) driDrawPriv->driverPrivate,
531 (GLframebuffer *) driReadPriv->driverPrivate);
532
533 intel->ctx.Driver.DrawBuffer( &intel->ctx, intel->ctx.Color.DrawBuffer[0] );
534 } else {
535 _mesa_make_current(NULL, NULL, NULL);
536 }
537
538 return GL_TRUE;
539 }
540
541
542 static void intelContendedLock( struct intel_context *intel, GLuint flags )
543 {
544 __DRIdrawablePrivate *dPriv = intel->driDrawable;
545 __DRIscreenPrivate *sPriv = intel->driScreen;
546 volatile drmI830Sarea * sarea = intel->sarea;
547 int me = intel->hHWContext;
548 int my_bufmgr = bmCtxId(intel);
549
550 drmGetLock(intel->driFd, intel->hHWContext, flags);
551
552 /* If the window moved, may need to set a new cliprect now.
553 *
554 * NOTE: This releases and regains the hw lock, so all state
555 * checking must be done *after* this call:
556 */
557 if (dPriv)
558 DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
559
560
561 intel->locked = 1;
562 intel->need_flush = 1;
563
564 /* Lost context?
565 */
566 if (sarea->ctxOwner != me) {
567 DBG("Lost Context: sarea->ctxOwner %x me %x\n", sarea->ctxOwner, me);
568 sarea->ctxOwner = me;
569 intel->vtbl.lost_hardware( intel );
570 }
571
572 /* As above, but don't evict the texture data on transitions
573 * between contexts which all share a local buffer manager.
574 */
575 if (sarea->texAge != my_bufmgr) {
576 DBG("Lost Textures: sarea->texAge %x my_bufmgr %x\n", sarea->ctxOwner, my_bufmgr);
577 sarea->texAge = my_bufmgr;
578 bm_fake_NotifyContendedLockTake( intel );
579 }
580
581 /* Drawable changed?
582 */
583 if (dPriv && intel->lastStamp != dPriv->lastStamp) {
584 intelWindowMoved( intel );
585 intel->lastStamp = dPriv->lastStamp;
586
587 /* This works because the lock is always grabbed before emitting
588 * commands and commands are always flushed prior to releasing
589 * the lock.
590 */
591 intel->NewGLState |= _NEW_WINDOW_POS;
592 }
593 }
594
595 _glthread_DECLARE_STATIC_MUTEX(lockMutex);
596
597 /* Lock the hardware and validate our state.
598 */
599 void LOCK_HARDWARE( struct intel_context *intel )
600 {
601 char __ret=0;
602
603 _glthread_LOCK_MUTEX(lockMutex);
604 assert(!intel->locked);
605
606
607 DRM_CAS(intel->driHwLock, intel->hHWContext,
608 (DRM_LOCK_HELD|intel->hHWContext), __ret);
609 if (__ret)
610 intelContendedLock( intel, 0 );
611
612 intel->locked = 1;
613
614 if (intel->aub_wrap) {
615 bm_fake_NotifyContendedLockTake( intel );
616 intel->vtbl.lost_hardware( intel );
617 intel->vtbl.aub_wrap(intel);
618 intel->aub_wrap = 0;
619 }
620
621 if (bmError(intel)) {
622 bmEvictAll(intel);
623 intel->vtbl.lost_hardware( intel );
624 }
625
626 /* Make sure nothing has been emitted prior to getting the lock:
627 */
628 assert(intel->batch->map == 0);
629
630 /* XXX: postpone, may not be needed:
631 */
632 if (!intel_batchbuffer_map(intel->batch)) {
633 bmEvictAll(intel);
634 intel->vtbl.lost_hardware( intel );
635
636 /* This could only fail if the batchbuffer was greater in size
637 * than the available texture memory:
638 */
639 if (!intel_batchbuffer_map(intel->batch)) {
640 _mesa_printf("double failure to map batchbuffer\n");
641 assert(0);
642 }
643 }
644 }
645
646
647 /* Unlock the hardware using the global current context
648 */
649 void UNLOCK_HARDWARE( struct intel_context *intel )
650 {
651 /* Make sure everything has been released:
652 */
653 assert(intel->batch->ptr == intel->batch->map + intel->batch->offset);
654
655 intel_batchbuffer_unmap(intel->batch);
656 intel->vtbl.note_unlock( intel );
657 intel->locked = 0;
658
659
660
661 DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext);
662 _glthread_UNLOCK_MUTEX(lockMutex);
663 }
664