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"
37 #include "swrast/swrast.h"
38 #include "swrast_setup/swrast_setup.h"
41 #include "tnl/t_pipeline.h"
42 #include "tnl/t_vertex.h"
44 #include "drivers/common/driverfuncs.h"
46 #include "intel_screen.h"
50 #include "intel_buffers.h"
51 #include "intel_tex.h"
52 #include "intel_span.h"
53 #include "intel_tris.h"
54 #include "intel_ioctl.h"
55 #include "intel_batchbuffer.h"
56 #include "intel_blit.h"
57 #include "intel_pixel.h"
58 #include "intel_regions.h"
59 #include "intel_buffer_objects.h"
60 #include "intel_fbo.h"
64 #include "xmlpool.h" /* for symbolic values of enum-type options */
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_EXT_blend_color
76 #define need_GL_EXT_blend_equation_separate
77 #define need_GL_EXT_blend_func_separate
78 #define need_GL_EXT_blend_minmax
79 #define need_GL_EXT_cull_vertex
80 #define need_GL_EXT_fog_coord
81 #define need_GL_EXT_framebuffer_object
82 #define need_GL_EXT_multi_draw_arrays
83 #define need_GL_EXT_secondary_color
84 #define need_GL_NV_vertex_program
85 #include "extension_helper.h"
88 #define DRIVER_DATE "20061102"
90 _glthread_Mutex lockMutex
;
91 static GLboolean lockMutexInit
= GL_FALSE
;
94 static const GLubyte
*
95 intelGetString(GLcontext
* ctx
, GLenum name
)
98 static char buffer
[128];
102 return (GLubyte
*) "Tungsten Graphics, Inc";
106 switch (intel_context(ctx
)->intelScreen
->deviceID
) {
108 chipset
= "Intel(R) 845G";
110 case PCI_CHIP_I830_M
:
111 chipset
= "Intel(R) 830M";
113 case PCI_CHIP_I855_GM
:
114 chipset
= "Intel(R) 852GM/855GM";
116 case PCI_CHIP_I865_G
:
117 chipset
= "Intel(R) 865G";
119 case PCI_CHIP_I915_G
:
120 chipset
= "Intel(R) 915G";
122 case PCI_CHIP_I915_GM
:
123 chipset
= "Intel(R) 915GM";
125 case PCI_CHIP_I945_G
:
126 chipset
= "Intel(R) 945G";
128 case PCI_CHIP_I945_GM
:
129 chipset
= "Intel(R) 945GM";
132 chipset
= "Unknown Intel Chipset";
136 (void) driGetRendererString(buffer
, chipset
, DRIVER_DATE
, 0);
137 return (GLubyte
*) buffer
;
146 * Extension strings exported by the intel driver.
149 * It appears that ARB_texture_env_crossbar has "disappeared" compared to the
150 * old i830-specific driver.
152 const struct dri_extension card_extensions
[] = {
153 {"GL_ARB_multisample", GL_ARB_multisample_functions
},
154 {"GL_ARB_multitexture", NULL
},
155 {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions
},
156 {"GL_ARB_texture_border_clamp", NULL
},
157 {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions
},
158 {"GL_ARB_texture_cube_map", NULL
},
159 {"GL_ARB_texture_env_add", NULL
},
160 {"GL_ARB_texture_env_combine", NULL
},
161 {"GL_ARB_texture_env_dot3", NULL
},
162 {"GL_ARB_texture_mirrored_repeat", NULL
},
163 {"GL_ARB_texture_rectangle", NULL
},
164 {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions
},
165 {"GL_ARB_pixel_buffer_object", NULL
},
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",
170 GL_EXT_blend_equation_separate_functions
},
171 {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions
},
172 {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions
},
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_framebuffer_object", GL_EXT_framebuffer_object_functions
},
177 {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions
},
178 #if 1 /* XXX FBO temporary? */
179 {"GL_EXT_packed_depth_stencil", NULL
},
181 {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions
},
182 {"GL_EXT_stencil_wrap", NULL
},
183 {"GL_EXT_texture_edge_clamp", NULL
},
184 {"GL_EXT_texture_env_combine", NULL
},
185 {"GL_EXT_texture_env_dot3", NULL
},
186 {"GL_EXT_texture_filter_anisotropic", NULL
},
187 {"GL_EXT_texture_lod_bias", NULL
},
188 {"GL_3DFX_texture_compression_FXT1", NULL
},
189 {"GL_APPLE_client_storage", NULL
},
190 {"GL_MESA_pack_invert", NULL
},
191 {"GL_MESA_ycbcr_texture", NULL
},
192 {"GL_NV_blend_square", NULL
},
193 {"GL_NV_vertex_program", GL_NV_vertex_program_functions
},
194 {"GL_NV_vertex_program1_1", NULL
},
195 /* { "GL_SGIS_generate_mipmap", NULL }, */
199 extern const struct tnl_pipeline_stage _intel_render_stage
;
201 static const struct tnl_pipeline_stage
*intel_pipeline
[] = {
202 &_tnl_vertex_transform_stage
,
203 &_tnl_vertex_cull_stage
,
204 &_tnl_normal_transform_stage
,
205 &_tnl_lighting_stage
,
206 &_tnl_fog_coordinate_stage
,
208 &_tnl_texture_transform_stage
,
209 &_tnl_point_attenuation_stage
,
210 &_tnl_arb_vertex_program_stage
,
211 &_tnl_vertex_program_stage
,
213 &_intel_render_stage
, /* ADD: unclipped rastersetup-to-dma */
220 static const struct dri_debug_control debug_control
[] = {
221 {"tex", DEBUG_TEXTURE
},
222 {"state", DEBUG_STATE
},
223 {"ioctl", DEBUG_IOCTL
},
224 {"blit", DEBUG_BLIT
},
225 {"mip", DEBUG_MIPTREE
},
226 {"fall", DEBUG_FALLBACKS
},
227 {"verb", DEBUG_VERBOSE
},
228 {"bat", DEBUG_BATCH
},
229 {"pix", DEBUG_PIXEL
},
230 {"buf", DEBUG_BUFMGR
},
231 {"reg", DEBUG_REGION
},
233 {"lock", DEBUG_LOCK
},
239 intelInvalidateState(GLcontext
* ctx
, GLuint new_state
)
241 _swrast_InvalidateState(ctx
, new_state
);
242 _swsetup_InvalidateState(ctx
, new_state
);
243 _vbo_InvalidateState(ctx
, new_state
);
244 _tnl_InvalidateState(ctx
, new_state
);
245 _tnl_invalidate_vertex_state(ctx
, new_state
);
246 intel_context(ctx
)->NewGLState
|= new_state
;
251 intelFlush(GLcontext
* ctx
)
253 struct intel_context
*intel
= intel_context(ctx
);
258 INTEL_FIREVERTICES(intel
);
260 if (intel
->batch
->map
!= intel
->batch
->ptr
)
261 intel_batchbuffer_flush(intel
->batch
);
263 /* XXX: Need to do an MI_FLUSH here.
269 * Check if we need to rotate/warp the front color buffer to the
270 * rotated screen. We generally need to do this when we get a glFlush
271 * or glFinish after drawing to the front color buffer.
274 intelCheckFrontRotate(GLcontext
* ctx
)
276 struct intel_context
*intel
= intel_context(ctx
);
277 if (intel
->ctx
.DrawBuffer
->_ColorDrawBufferMask
[0] ==
278 BUFFER_BIT_FRONT_LEFT
) {
279 intelScreenPrivate
*screen
= intel
->intelScreen
;
280 if (screen
->current_rotation
!= 0) {
281 __DRIdrawablePrivate
*dPriv
= intel
->driDrawable
;
282 intelRotateWindow(intel
, dPriv
, BUFFER_BIT_FRONT_LEFT
);
289 * Called via glFlush.
292 intelglFlush(GLcontext
* ctx
)
295 intelCheckFrontRotate(ctx
);
299 intelFinish(GLcontext
* ctx
)
301 struct intel_context
*intel
= intel_context(ctx
);
303 if (intel
->batch
->last_fence
) {
304 driFenceFinish(intel
->batch
->last_fence
,
306 driFenceUnReference(intel
->batch
->last_fence
);
307 intel
->batch
->last_fence
= NULL
;
309 intelCheckFrontRotate(ctx
);
314 intelInitDriverFunctions(struct dd_function_table
*functions
)
316 _mesa_init_driver_functions(functions
);
318 functions
->Flush
= intelglFlush
;
319 functions
->Finish
= intelFinish
;
320 functions
->GetString
= intelGetString
;
321 functions
->UpdateState
= intelInvalidateState
;
322 functions
->CopyColorTable
= _swrast_CopyColorTable
;
323 functions
->CopyColorSubTable
= _swrast_CopyColorSubTable
;
324 functions
->CopyConvolutionFilter1D
= _swrast_CopyConvolutionFilter1D
;
325 functions
->CopyConvolutionFilter2D
= _swrast_CopyConvolutionFilter2D
;
327 intelInitTextureFuncs(functions
);
328 intelInitPixelFuncs(functions
);
329 intelInitStateFuncs(functions
);
330 intelInitBufferFuncs(functions
);
335 intelInitContext(struct intel_context
*intel
,
336 const __GLcontextModes
* mesaVis
,
337 __DRIcontextPrivate
* driContextPriv
,
338 void *sharedContextPrivate
,
339 struct dd_function_table
*functions
)
341 GLcontext
*ctx
= &intel
->ctx
;
342 GLcontext
*shareCtx
= (GLcontext
*) sharedContextPrivate
;
343 __DRIscreenPrivate
*sPriv
= driContextPriv
->driScreenPriv
;
344 intelScreenPrivate
*intelScreen
= (intelScreenPrivate
*) sPriv
->private;
345 drmI830Sarea
*saPriv
= (drmI830Sarea
*)
346 (((GLubyte
*) sPriv
->pSAREA
) + intelScreen
->sarea_priv_offset
);
349 if (!_mesa_initialize_context(&intel
->ctx
,
351 functions
, (void *) intel
))
354 driContextPriv
->driverPrivate
= intel
;
355 intel
->intelScreen
= intelScreen
;
356 intel
->driScreen
= sPriv
;
357 intel
->sarea
= saPriv
;
359 if (!lockMutexInit
) {
360 lockMutexInit
= GL_TRUE
;
361 _glthread_INIT_MUTEX(lockMutex
);
364 driParseConfigFiles(&intel
->optionCache
, &intelScreen
->optionCache
,
365 intel
->driScreen
->myNum
, "i915");
367 ctx
->Const
.MaxTextureMaxAnisotropy
= 2.0;
369 /* This doesn't yet catch all non-conformant rendering, but it's a
372 if (getenv("INTEL_STRICT_CONFORMANCE")) {
373 intel
->strict_conformance
= 1;
376 ctx
->Const
.MinLineWidth
= 1.0;
377 ctx
->Const
.MinLineWidthAA
= 1.0;
378 ctx
->Const
.MaxLineWidth
= 3.0;
379 ctx
->Const
.MaxLineWidthAA
= 3.0;
380 ctx
->Const
.LineWidthGranularity
= 1.0;
382 ctx
->Const
.MinPointSize
= 1.0;
383 ctx
->Const
.MinPointSizeAA
= 1.0;
384 ctx
->Const
.MaxPointSize
= 255.0;
385 ctx
->Const
.MaxPointSizeAA
= 3.0;
386 ctx
->Const
.PointSizeGranularity
= 1.0;
388 ctx
->Const
.MaxColorAttachments
= 4; /* XXX FBO: review this */
390 /* Initialize the software rasterizer and helper modules. */
391 _swrast_CreateContext(ctx
);
392 _vbo_CreateContext(ctx
);
393 _tnl_CreateContext(ctx
);
394 _swsetup_CreateContext(ctx
);
396 /* Install the customized pipeline: */
397 _tnl_destroy_pipeline(ctx
);
398 _tnl_install_pipeline(ctx
, intel_pipeline
);
400 /* Configure swrast to match hardware characteristics: */
401 _swrast_allow_pixel_fog(ctx
, GL_FALSE
);
402 _swrast_allow_vertex_fog(ctx
, GL_TRUE
);
405 intel
->hHWContext
= driContextPriv
->hHWContext
;
406 intel
->driFd
= sPriv
->fd
;
407 intel
->driHwLock
= (drmLock
*) & sPriv
->pSAREA
->lock
;
409 intel
->hw_stipple
= 1;
411 /* XXX FBO: this doesn't seem to be used anywhere */
412 switch (mesaVis
->depthBits
) {
413 case 0: /* what to do in this case? */
415 intel
->polygon_offset_scale
= 1.0 / 0xffff;
418 intel
->polygon_offset_scale
= 2.0 / 0xffffff; /* req'd to pass glean */
425 /* Initialize swrast, tnl driver tables: */
426 intelInitSpanFuncs(ctx
);
427 intelInitTriFuncs(ctx
);
430 intel
->RenderIndex
= ~0;
432 fthrottle_mode
= driQueryOptioni(&intel
->optionCache
, "fthrottle_mode");
433 intel
->iw
.irq_seq
= -1;
434 intel
->irqsEmitted
= 0;
436 intel
->do_irqs
= (intel
->intelScreen
->irq_active
&&
437 fthrottle_mode
== DRI_CONF_FTHROTTLE_IRQS
);
439 intel
->do_usleeps
= (fthrottle_mode
== DRI_CONF_FTHROTTLE_USLEEPS
);
441 intel
->vblank_flags
= (intel
->intelScreen
->irq_active
!= 0)
442 ? driGetDefaultVBlankFlags(&intel
->optionCache
) : VBLANK_FLAG_NO_IRQ
;
444 (*dri_interface
->getUST
) (&intel
->swap_ust
);
445 _math_matrix_ctr(&intel
->ViewportMatrix
);
447 /* Disable imaging extension until convolution is working in
450 driInitExtensions(ctx
, card_extensions
,
455 intel
->batch
= intel_batchbuffer_alloc(intel
);
456 intel
->last_swap_fence
= NULL
;
457 intel
->first_swap_fence
= NULL
;
459 intel_bufferobj_init(intel
);
460 intel_fbo_init(intel
);
462 if (intel
->ctx
.Mesa_DXTn
) {
463 _mesa_enable_extension(ctx
, "GL_EXT_texture_compression_s3tc");
464 _mesa_enable_extension(ctx
, "GL_S3_s3tc");
466 else if (driQueryOptionb(&intel
->optionCache
, "force_s3tc_enable")) {
467 _mesa_enable_extension(ctx
, "GL_EXT_texture_compression_s3tc");
470 intel
->prim
.primitive
= ~0;
474 INTEL_DEBUG
= driParseDebugString(getenv("INTEL_DEBUG"), debug_control
);
477 if (getenv("INTEL_NO_RAST")) {
478 fprintf(stderr
, "disabling 3D rasterization\n");
479 FALLBACK(intel
, INTEL_FALLBACK_USER
, 1);
486 intelDestroyContext(__DRIcontextPrivate
* driContextPriv
)
488 struct intel_context
*intel
=
489 (struct intel_context
*) driContextPriv
->driverPrivate
;
491 assert(intel
); /* should never be null */
493 GLboolean release_texture_heaps
;
495 INTEL_FIREVERTICES(intel
);
497 intel
->vtbl
.destroy(intel
);
499 release_texture_heaps
= (intel
->ctx
.Shared
->RefCount
== 1);
500 _swsetup_DestroyContext(&intel
->ctx
);
501 _tnl_DestroyContext(&intel
->ctx
);
502 _vbo_DestroyContext(&intel
->ctx
);
504 _swrast_DestroyContext(&intel
->ctx
);
505 intel
->Fallback
= 0; /* don't call _swrast_Flush later */
507 intel_batchbuffer_free(intel
->batch
);
509 if (intel
->last_swap_fence
) {
510 driFenceFinish(intel
->last_swap_fence
, DRM_FENCE_TYPE_EXE
, GL_TRUE
);
511 driFenceUnReference(intel
->last_swap_fence
);
512 intel
->last_swap_fence
= NULL
;
514 if (intel
->first_swap_fence
) {
515 driFenceFinish(intel
->first_swap_fence
, DRM_FENCE_TYPE_EXE
, GL_TRUE
);
516 driFenceUnReference(intel
->first_swap_fence
);
517 intel
->first_swap_fence
= NULL
;
521 if (release_texture_heaps
) {
522 /* This share group is about to go away, free our private
523 * texture object data.
525 if (INTEL_DEBUG
& DEBUG_TEXTURE
)
526 fprintf(stderr
, "do something to free texture heaps\n");
529 /* free the Mesa context */
530 _mesa_free_context_data(&intel
->ctx
);
535 intelUnbindContext(__DRIcontextPrivate
* driContextPriv
)
541 intelMakeCurrent(__DRIcontextPrivate
* driContextPriv
,
542 __DRIdrawablePrivate
* driDrawPriv
,
543 __DRIdrawablePrivate
* driReadPriv
)
546 if (driContextPriv
) {
547 struct intel_context
*intel
=
548 (struct intel_context
*) driContextPriv
->driverPrivate
;
549 GLframebuffer
*drawFb
= (GLframebuffer
*) driDrawPriv
->driverPrivate
;
550 GLframebuffer
*readFb
= (GLframebuffer
*) driReadPriv
->driverPrivate
;
553 /* XXX FBO temporary fix-ups! */
554 /* if the renderbuffers don't have regions, init them from the context */
556 struct intel_renderbuffer
*irbFront
557 = intel_get_renderbuffer(drawFb
, BUFFER_FRONT_LEFT
);
558 struct intel_renderbuffer
*irbBack
559 = intel_get_renderbuffer(drawFb
, BUFFER_BACK_LEFT
);
560 struct intel_renderbuffer
*irbDepth
561 = intel_get_renderbuffer(drawFb
, BUFFER_DEPTH
);
562 struct intel_renderbuffer
*irbStencil
563 = intel_get_renderbuffer(drawFb
, BUFFER_STENCIL
);
565 if (irbFront
&& !irbFront
->region
) {
566 intel_region_reference(&irbFront
->region
, intel
->intelScreen
->front_region
);
568 if (irbBack
&& !irbBack
->region
) {
569 intel_region_reference(&irbBack
->region
, intel
->intelScreen
->back_region
);
571 if (irbDepth
&& !irbDepth
->region
) {
572 intel_region_reference(&irbDepth
->region
, intel
->intelScreen
->depth_region
);
574 if (irbStencil
&& !irbStencil
->region
) {
575 intel_region_reference(&irbStencil
->region
, intel
->intelScreen
->depth_region
);
579 /* set initial GLframebuffer size to match window, if needed */
580 if (drawFb
->Width
== 0 && driDrawPriv
->w
) {
581 _mesa_resize_framebuffer(&intel
->ctx
, drawFb
,
582 driDrawPriv
->w
, driDrawPriv
->h
);
584 if (readFb
->Width
== 0 && driReadPriv
->w
) {
585 _mesa_resize_framebuffer(&intel
->ctx
, readFb
,
586 driReadPriv
->w
, driReadPriv
->h
);
589 _mesa_make_current(&intel
->ctx
, drawFb
, readFb
);
591 /* The drawbuffer won't always be updated by _mesa_make_current:
593 if (intel
->ctx
.DrawBuffer
== drawFb
) {
595 if (intel
->driDrawable
!= driDrawPriv
) {
596 driDrawableInitVBlank(driDrawPriv
, intel
->vblank_flags
, &intel
->vbl_seq
);
597 intel
->driDrawable
= driDrawPriv
;
598 intelWindowMoved(intel
);
601 intel_draw_buffer(&intel
->ctx
, drawFb
);
605 _mesa_make_current(NULL
, NULL
, NULL
);
612 intelContendedLock(struct intel_context
*intel
, GLuint flags
)
614 __DRIdrawablePrivate
*dPriv
= intel
->driDrawable
;
615 __DRIscreenPrivate
*sPriv
= intel
->driScreen
;
616 intelScreenPrivate
*intelScreen
= (intelScreenPrivate
*) sPriv
->private;
617 drmI830Sarea
*sarea
= intel
->sarea
;
619 drmGetLock(intel
->driFd
, intel
->hHWContext
, flags
);
621 if (INTEL_DEBUG
& DEBUG_LOCK
)
622 _mesa_printf("%s - got contended lock\n", __progname
);
624 /* If the window moved, may need to set a new cliprect now.
626 * NOTE: This releases and regains the hw lock, so all state
627 * checking must be done *after* this call:
630 DRI_VALIDATE_DRAWABLE_INFO(sPriv
, dPriv
);
632 if (sarea
->width
!= intelScreen
->width
||
633 sarea
->height
!= intelScreen
->height
||
634 sarea
->rotation
!= intelScreen
->current_rotation
) {
636 intelUpdateScreenRotation(sPriv
, sarea
);
639 * This will drop the outstanding batchbuffer on the floor
640 * FIXME: This should be done for all contexts?
643 intel_batchbuffer_reset(intel
->batch
);
645 /* lose all primitives */
646 intel
->prim
.primitive
= ~0;
647 intel
->prim
.start_ptr
= 0;
648 intel
->prim
.flush
= 0;
650 /* re-emit all state */
651 intel
->vtbl
.lost_hardware(intel
);
653 /* force window update */
654 intel
->lastStamp
= 0;
660 if (dPriv
&& intel
->lastStamp
!= dPriv
->lastStamp
) {
661 intelWindowMoved(intel
);
662 intel
->lastStamp
= dPriv
->lastStamp
;
667 /* Lock the hardware and validate our state.
669 void LOCK_HARDWARE( struct intel_context
*intel
)
673 _glthread_LOCK_MUTEX(lockMutex
);
674 assert(!intel
->locked
);
676 if (intel
->swap_scheduled
) {
678 vbl
.request
.type
= DRM_VBLANK_ABSOLUTE
;
679 if ( intel
->vblank_flags
& VBLANK_FLAG_SECONDARY
) {
680 vbl
.request
.type
|= DRM_VBLANK_SECONDARY
;
682 vbl
.request
.sequence
= intel
->vbl_seq
;
683 drmWaitVBlank(intel
->driFd
, &vbl
);
684 intel
->swap_scheduled
= 0;
687 DRM_CAS(intel
->driHwLock
, intel
->hHWContext
,
688 (DRM_LOCK_HELD
|intel
->hHWContext
), __ret
);
691 intelContendedLock( intel
, 0 );
693 if (INTEL_DEBUG
& DEBUG_LOCK
)
694 _mesa_printf("%s - locked\n", __progname
);
700 /* Unlock the hardware using the global current context
702 void UNLOCK_HARDWARE( struct intel_context
*intel
)
706 DRM_UNLOCK(intel
->driFd
, intel
->driHwLock
, intel
->hHWContext
);
708 _glthread_UNLOCK_MUTEX(lockMutex
);
710 if (INTEL_DEBUG
& DEBUG_LOCK
)
711 _mesa_printf("%s - unlocked\n", __progname
);