2 Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
4 The Weather Channel (TM) funded Tungsten Graphics to develop the
5 initial release of the Radeon 8500 driver under the XFree86 license.
6 This notice must be preserved.
8 Permission is hereby granted, free of charge, to any person obtaining
9 a copy of this software and associated documentation files (the
10 "Software"), to deal in the Software without restriction, including
11 without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense, and/or sell copies of the Software, and to
13 permit persons to whom the Software is furnished to do so, subject to
14 the following conditions:
16 The above copyright notice and this permission notice (including the
17 next paragraph) shall be included in all copies or substantial
18 portions of the Software.
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
24 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 **************************************************************************/
32 * Keith Whitwell <keith@tungstengraphics.com>
35 #include "main/glheader.h"
36 #include "main/api_arrayelt.h"
37 #include "main/context.h"
38 #include "main/simple_list.h"
39 #include "main/imports.h"
40 #include "main/matrix.h"
41 #include "main/extensions.h"
42 #include "main/framebuffer.h"
43 #include "main/state.h"
45 #include "swrast/swrast.h"
46 #include "swrast_setup/swrast_setup.h"
50 #include "tnl/t_pipeline.h"
52 #include "drivers/common/driverfuncs.h"
54 #include "r200_context.h"
55 #include "r200_ioctl.h"
56 #include "r200_state.h"
57 #include "r200_span.h"
58 #include "r200_pixel.h"
60 #include "r200_swtcl.h"
62 #include "r200_maos.h"
63 #include "r200_vertprog.h"
65 #define need_GL_ARB_multisample
66 #define need_GL_ARB_texture_compression
67 #define need_GL_ARB_vertex_buffer_object
68 #define need_GL_ARB_vertex_program
69 #define need_GL_ATI_fragment_shader
70 #define need_GL_EXT_blend_minmax
71 #define need_GL_EXT_fog_coord
72 #define need_GL_EXT_multi_draw_arrays
73 #define need_GL_EXT_secondary_color
74 #define need_GL_EXT_blend_equation_separate
75 #define need_GL_EXT_blend_func_separate
76 #define need_GL_NV_vertex_program
77 #define need_GL_ARB_point_parameters
78 #include "extension_helper.h"
80 #define DRIVER_DATE "20060602"
84 #include "xmlpool.h" /* for symbolic values of enum-type options */
86 /* Return various strings for glGetString().
88 static const GLubyte
*r200GetString( GLcontext
*ctx
, GLenum name
)
90 r200ContextPtr rmesa
= R200_CONTEXT(ctx
);
91 static char buffer
[128];
93 GLuint agp_mode
= (rmesa
->radeon
.radeonScreen
->card_type
== RADEON_CARD_PCI
)? 0 :
94 rmesa
->radeon
.radeonScreen
->AGPMode
;
98 return (GLubyte
*)"Tungsten Graphics, Inc.";
101 offset
= driGetRendererString( buffer
, "R200", DRIVER_DATE
,
104 sprintf( & buffer
[ offset
], " %sTCL",
105 !(rmesa
->radeon
.TclFallback
& R200_TCL_FALLBACK_TCL_DISABLE
)
108 return (GLubyte
*)buffer
;
116 /* Extension strings exported by the R200 driver.
118 const struct dri_extension card_extensions
[] =
120 { "GL_ARB_multisample", GL_ARB_multisample_functions
},
121 { "GL_ARB_multitexture", NULL
},
122 { "GL_ARB_texture_border_clamp", NULL
},
123 { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions
},
124 { "GL_ARB_texture_env_add", NULL
},
125 { "GL_ARB_texture_env_combine", NULL
},
126 { "GL_ARB_texture_env_dot3", NULL
},
127 { "GL_ARB_texture_env_crossbar", NULL
},
128 { "GL_ARB_texture_mirrored_repeat", NULL
},
129 { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions
},
130 { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions
},
131 { "GL_EXT_blend_subtract", NULL
},
132 { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions
},
133 { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions
},
134 { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions
},
135 { "GL_EXT_stencil_wrap", NULL
},
136 { "GL_EXT_texture_edge_clamp", NULL
},
137 { "GL_EXT_texture_env_combine", NULL
},
138 { "GL_EXT_texture_env_dot3", NULL
},
139 { "GL_EXT_texture_filter_anisotropic", NULL
},
140 { "GL_EXT_texture_lod_bias", NULL
},
141 { "GL_EXT_texture_mirror_clamp", NULL
},
142 { "GL_EXT_texture_rectangle", NULL
},
143 { "GL_ATI_texture_env_combine3", NULL
},
144 { "GL_ATI_texture_mirror_once", NULL
},
145 { "GL_MESA_pack_invert", NULL
},
146 { "GL_NV_blend_square", NULL
},
147 { "GL_SGIS_generate_mipmap", NULL
},
151 const struct dri_extension blend_extensions
[] = {
152 { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions
},
153 { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions
},
157 const struct dri_extension ARB_vp_extension
[] = {
158 { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions
}
161 const struct dri_extension NV_vp_extension
[] = {
162 { "GL_NV_vertex_program", GL_NV_vertex_program_functions
}
165 const struct dri_extension ATI_fs_extension
[] = {
166 { "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions
}
169 const struct dri_extension point_extensions
[] = {
170 { "GL_ARB_point_sprite", NULL
},
171 { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions
},
175 extern const struct tnl_pipeline_stage _r200_render_stage
;
176 extern const struct tnl_pipeline_stage _r200_tcl_stage
;
178 static const struct tnl_pipeline_stage
*r200_pipeline
[] = {
180 /* Try and go straight to t&l
184 /* Catch any t&l fallbacks
186 &_tnl_vertex_transform_stage
,
187 &_tnl_normal_transform_stage
,
188 &_tnl_lighting_stage
,
189 &_tnl_fog_coordinate_stage
,
191 &_tnl_texture_transform_stage
,
192 &_tnl_point_attenuation_stage
,
193 &_tnl_vertex_program_stage
,
194 /* Try again to go to tcl?
195 * - no good for asymmetric-twoside (do with multipass)
196 * - no good for asymmetric-unfilled (do with multipass)
197 * - good for material
199 * - need to manipulate a bit of state
201 * - worth it/not worth it?
204 /* Else do them here.
206 /* &_r200_render_stage, */ /* FIXME: bugs with ut2003 */
207 &_tnl_render_stage
, /* FALLBACK: */
213 /* Initialize the driver's misc functions.
215 static void r200InitDriverFuncs( struct dd_function_table
*functions
)
217 functions
->GetBufferSize
= NULL
; /* OBSOLETE */
218 functions
->GetString
= r200GetString
;
221 static const struct dri_debug_control debug_control
[] =
223 { "fall", DEBUG_FALLBACKS
},
224 { "tex", DEBUG_TEXTURE
},
225 { "ioctl", DEBUG_IOCTL
},
226 { "prim", DEBUG_PRIMS
},
227 { "vert", DEBUG_VERTS
},
228 { "state", DEBUG_STATE
},
229 { "code", DEBUG_CODEGEN
},
230 { "vfmt", DEBUG_VFMT
},
231 { "vtxf", DEBUG_VFMT
},
232 { "verb", DEBUG_VERBOSE
},
233 { "dri", DEBUG_DRI
},
234 { "dma", DEBUG_DMA
},
235 { "san", DEBUG_SANITY
},
236 { "sync", DEBUG_SYNC
},
237 { "pix", DEBUG_PIXEL
},
238 { "mem", DEBUG_MEMORY
},
242 static void r200_get_lock(radeonContextPtr radeon
)
244 r200ContextPtr rmesa
= (r200ContextPtr
)radeon
;
245 drm_radeon_sarea_t
*sarea
= radeon
->sarea
;
248 R200_STATECHANGE( rmesa
, ctx
);
249 if (rmesa
->radeon
.sarea
->tiling_enabled
) {
250 rmesa
->hw
.ctx
.cmd
[CTX_RB3D_COLORPITCH
] |= R200_COLOR_TILE_ENABLE
;
252 else rmesa
->hw
.ctx
.cmd
[CTX_RB3D_COLORPITCH
] &= ~R200_COLOR_TILE_ENABLE
;
254 if ( sarea
->ctx_owner
!= rmesa
->radeon
.dri
.hwContext
) {
255 sarea
->ctx_owner
= rmesa
->radeon
.dri
.hwContext
;
258 for ( i
= 0 ; i
< rmesa
->radeon
.nr_heaps
; i
++ ) {
259 DRI_AGE_TEXTURES( rmesa
->radeon
.texture_heaps
[ i
] );
264 static void r200_vtbl_flush(GLcontext
*ctx
)
266 R200_FIREVERTICES(R200_CONTEXT(ctx
));
269 static void r200_vtbl_set_all_dirty(GLcontext
*ctx
)
271 r200ContextPtr rmesa
= R200_CONTEXT(ctx
);
272 rmesa
->hw
.all_dirty
= GL_TRUE
;
275 static void r200_vtbl_emit_cs_header(struct radeon_cs
*cs
, radeonContextPtr rmesa
)
279 static void r200_vtbl_emit_state(radeonContextPtr rmesa
)
281 r200EmitState((r200ContextPtr
)rmesa
);
284 static void r200_init_vtbl(radeonContextPtr radeon
)
286 radeon
->vtbl
.get_lock
= r200_get_lock
;
287 radeon
->vtbl
.update_viewport_offset
= r200UpdateViewportOffset
;
288 radeon
->vtbl
.flush
= r200_vtbl_flush
;
289 radeon
->vtbl
.set_all_dirty
= r200_vtbl_set_all_dirty
;
290 radeon
->vtbl
.update_draw_buffer
= r200UpdateDrawBuffer
;
291 radeon
->vtbl
.emit_cs_header
= r200_vtbl_emit_cs_header
;
292 radeon
->vtbl
.emit_state
= r200_vtbl_emit_state
;
296 /* Create the device specific rendering context.
298 GLboolean
r200CreateContext( const __GLcontextModes
*glVisual
,
299 __DRIcontextPrivate
*driContextPriv
,
300 void *sharedContextPrivate
)
302 __DRIscreenPrivate
*sPriv
= driContextPriv
->driScreenPriv
;
303 radeonScreenPtr screen
= (radeonScreenPtr
)(sPriv
->private);
304 struct dd_function_table functions
;
305 r200ContextPtr rmesa
;
311 assert(driContextPriv
);
314 /* Allocate the R200 context */
315 rmesa
= (r200ContextPtr
) CALLOC( sizeof(*rmesa
) );
319 r200_init_vtbl(&rmesa
->radeon
);
320 /* init exp fog table data */
321 r200InitStaticFogData();
323 /* Parse configuration files.
324 * Do this here so that initialMaxAnisotropy is set before we create
325 * the default textures.
327 driParseConfigFiles (&rmesa
->radeon
.optionCache
, &screen
->optionCache
,
328 screen
->driScreen
->myNum
, "r200");
329 rmesa
->radeon
.initialMaxAnisotropy
= driQueryOptionf(&rmesa
->radeon
.optionCache
,
330 "def_max_anisotropy");
332 if ( driQueryOptionb( &rmesa
->radeon
.optionCache
, "hyperz" ) ) {
333 if ( sPriv
->drm_version
.minor
< 13 )
334 fprintf( stderr
, "DRM version 1.%d too old to support HyperZ, "
335 "disabling.\n", sPriv
->drm_version
.minor
);
337 rmesa
->using_hyperz
= GL_TRUE
;
340 if ( sPriv
->drm_version
.minor
>= 15 )
341 rmesa
->texmicrotile
= GL_TRUE
;
343 /* Init default driver functions then plug in our R200-specific functions
344 * (the texture functions are especially important)
346 _mesa_init_driver_functions(&functions
);
347 r200InitDriverFuncs(&functions
);
348 r200InitIoctlFuncs(&functions
);
349 r200InitStateFuncs(&functions
);
350 r200InitTextureFuncs(&functions
);
351 r200InitShaderFuncs(&functions
);
353 if (!radeonInitContext(&rmesa
->radeon
, &functions
,
354 glVisual
, driContextPriv
,
355 sharedContextPrivate
)) {
361 rmesa
->dma
.buf0_address
= rmesa
->radeon
.radeonScreen
->buffers
->list
[0].address
;
363 (void) memset( rmesa
->radeon
.texture_heaps
, 0, sizeof( rmesa
->radeon
.texture_heaps
) );
364 make_empty_list( & rmesa
->radeon
.swapped
);
366 rmesa
->radeon
.nr_heaps
= 1 /* screen->numTexHeaps */ ;
367 assert(rmesa
->radeon
.nr_heaps
< RADEON_NR_TEX_HEAPS
);
368 for ( i
= 0 ; i
< rmesa
->radeon
.nr_heaps
; i
++ ) {
369 rmesa
->radeon
.texture_heaps
[i
] = driCreateTextureHeap( i
, rmesa
,
372 RADEON_NR_TEX_REGIONS
,
373 (drmTextureRegionPtr
)rmesa
->radeon
.sarea
->tex_list
[i
],
374 & rmesa
->radeon
.sarea
->tex_age
[i
],
375 & rmesa
->radeon
.swapped
,
376 sizeof( radeonTexObj
),
377 (destroy_texture_object_t
*) r200DestroyTexObj
);
379 rmesa
->radeon
.texture_depth
= driQueryOptioni (&rmesa
->radeon
.optionCache
,
381 if (rmesa
->radeon
.texture_depth
== DRI_CONF_TEXTURE_DEPTH_FB
)
382 rmesa
->radeon
.texture_depth
= ( screen
->cpp
== 4 ) ?
383 DRI_CONF_TEXTURE_DEPTH_32
: DRI_CONF_TEXTURE_DEPTH_16
;
385 rmesa
->swtcl
.RenderIndex
= ~0;
386 rmesa
->hw
.all_dirty
= 1;
388 /* Set the maximum texture size small enough that we can guarentee that
389 * all texture units can bind a maximal texture and have all of them in
390 * texturable memory at once. Depending on the allow_large_textures driconf
391 * setting allow larger textures.
394 ctx
= rmesa
->radeon
.glCtx
;
395 ctx
->Const
.MaxTextureUnits
= driQueryOptioni (&rmesa
->radeon
.optionCache
,
397 ctx
->Const
.MaxTextureImageUnits
= ctx
->Const
.MaxTextureUnits
;
398 ctx
->Const
.MaxTextureCoordUnits
= ctx
->Const
.MaxTextureUnits
;
400 i
= driQueryOptioni( &rmesa
->radeon
.optionCache
, "allow_large_textures");
402 driCalculateMaxTextureLevels( rmesa
->radeon
.texture_heaps
,
403 rmesa
->radeon
.nr_heaps
,
406 11, /* max 2D texture size is 2048x2048 */
407 #if ENABLE_HW_3D_TEXTURE
408 8, /* max 3D texture size is 256^3 */
410 0, /* 3D textures unsupported */
412 11, /* max cube texture size is 2048x2048 */
413 11, /* max texture rectangle size is 2048x2048 */
418 ctx
->Const
.MaxTextureMaxAnisotropy
= 16.0;
420 /* No wide AA points.
422 ctx
->Const
.MinPointSize
= 1.0;
423 ctx
->Const
.MinPointSizeAA
= 1.0;
424 ctx
->Const
.MaxPointSizeAA
= 1.0;
425 ctx
->Const
.PointSizeGranularity
= 0.0625;
426 if (rmesa
->radeon
.radeonScreen
->drmSupportsPointSprites
)
427 ctx
->Const
.MaxPointSize
= 2047.0;
429 ctx
->Const
.MaxPointSize
= 1.0;
431 /* mesa initialization problem - _mesa_init_point was already called */
432 ctx
->Point
.MaxSize
= ctx
->Const
.MaxPointSize
;
434 ctx
->Const
.MinLineWidth
= 1.0;
435 ctx
->Const
.MinLineWidthAA
= 1.0;
436 ctx
->Const
.MaxLineWidth
= 10.0;
437 ctx
->Const
.MaxLineWidthAA
= 10.0;
438 ctx
->Const
.LineWidthGranularity
= 0.0625;
440 ctx
->Const
.VertexProgram
.MaxNativeInstructions
= R200_VSF_MAX_INST
;
441 ctx
->Const
.VertexProgram
.MaxNativeAttribs
= 12;
442 ctx
->Const
.VertexProgram
.MaxNativeTemps
= R200_VSF_MAX_TEMPS
;
443 ctx
->Const
.VertexProgram
.MaxNativeParameters
= R200_VSF_MAX_PARAM
;
444 ctx
->Const
.VertexProgram
.MaxNativeAddressRegs
= 1;
446 /* Initialize the software rasterizer and helper modules.
448 _swrast_CreateContext( ctx
);
449 _vbo_CreateContext( ctx
);
450 _tnl_CreateContext( ctx
);
451 _swsetup_CreateContext( ctx
);
452 _ae_create_context( ctx
);
454 /* Install the customized pipeline:
456 _tnl_destroy_pipeline( ctx
);
457 _tnl_install_pipeline( ctx
, r200_pipeline
);
459 /* Try and keep materials and vertices separate:
461 /* _tnl_isolate_materials( ctx, GL_TRUE ); */
464 /* Configure swrast and TNL to match hardware characteristics:
466 _swrast_allow_pixel_fog( ctx
, GL_FALSE
);
467 _swrast_allow_vertex_fog( ctx
, GL_TRUE
);
468 _tnl_allow_pixel_fog( ctx
, GL_FALSE
);
469 _tnl_allow_vertex_fog( ctx
, GL_TRUE
);
472 for ( i
= 0 ; i
< R200_MAX_TEXTURE_UNITS
; i
++ ) {
473 _math_matrix_ctr( &rmesa
->TexGenMatrix
[i
] );
474 _math_matrix_set_identity( &rmesa
->TexGenMatrix
[i
] );
476 _math_matrix_ctr( &rmesa
->tmpmat
);
477 _math_matrix_set_identity( &rmesa
->tmpmat
);
479 driInitExtensions( ctx
, card_extensions
, GL_TRUE
);
480 if (!(rmesa
->radeon
.radeonScreen
->chip_flags
& R200_CHIPSET_YCBCR_BROKEN
)) {
481 /* yuv textures don't work with some chips - R200 / rv280 okay so far
482 others get the bit ordering right but don't actually do YUV-RGB conversion */
483 _mesa_enable_extension( ctx
, "GL_MESA_ycbcr_texture" );
485 if (rmesa
->radeon
.glCtx
->Mesa_DXTn
) {
486 _mesa_enable_extension( ctx
, "GL_EXT_texture_compression_s3tc" );
487 _mesa_enable_extension( ctx
, "GL_S3_s3tc" );
489 else if (driQueryOptionb (&rmesa
->radeon
.optionCache
, "force_s3tc_enable")) {
490 _mesa_enable_extension( ctx
, "GL_EXT_texture_compression_s3tc" );
493 if (rmesa
->radeon
.radeonScreen
->drmSupportsCubeMapsR200
)
494 _mesa_enable_extension( ctx
, "GL_ARB_texture_cube_map" );
495 if (rmesa
->radeon
.radeonScreen
->drmSupportsBlendColor
) {
496 driInitExtensions( ctx
, blend_extensions
, GL_FALSE
);
498 if(rmesa
->radeon
.radeonScreen
->drmSupportsVertexProgram
)
499 driInitSingleExtension( ctx
, ARB_vp_extension
);
500 if(driQueryOptionb(&rmesa
->radeon
.optionCache
, "nv_vertex_program"))
501 driInitSingleExtension( ctx
, NV_vp_extension
);
503 if ((ctx
->Const
.MaxTextureUnits
== 6) && rmesa
->radeon
.radeonScreen
->drmSupportsFragShader
)
504 driInitSingleExtension( ctx
, ATI_fs_extension
);
505 if (rmesa
->radeon
.radeonScreen
->drmSupportsPointSprites
)
506 driInitExtensions( ctx
, point_extensions
, GL_FALSE
);
508 r200InitDriverFuncs( ctx
);
509 r200InitIoctlFuncs( ctx
);
510 r200InitStateFuncs( ctx
);
511 r200InitTextureFuncs( ctx
);
513 /* plug in a few more device driver functions */
514 /* XXX these should really go right after _mesa_init_driver_functions() */
515 r200InitPixelFuncs( ctx
);
516 r200InitSpanFuncs( ctx
);
517 r200InitTnlFuncs( ctx
);
518 r200InitState( rmesa
);
519 r200InitSwtcl( ctx
);
521 rmesa
->prefer_gart_client_texturing
=
522 (getenv("R200_GART_CLIENT_TEXTURES") != 0);
525 R200_DEBUG
= driParseDebugString( getenv( "R200_DEBUG" ),
527 R200_DEBUG
|= driParseDebugString( getenv( "RADEON_DEBUG" ),
531 tcl_mode
= driQueryOptioni(&rmesa
->radeon
.optionCache
, "tcl_mode");
532 if (driQueryOptionb(&rmesa
->radeon
.optionCache
, "no_rast")) {
533 fprintf(stderr
, "disabling 3D acceleration\n");
534 FALLBACK(rmesa
, R200_FALLBACK_DISABLE
, 1);
536 else if (tcl_mode
== DRI_CONF_TCL_SW
|| getenv("R200_NO_TCL") ||
537 !(rmesa
->radeon
.radeonScreen
->chip_flags
& RADEON_CHIPSET_TCL
)) {
538 if (rmesa
->radeon
.radeonScreen
->chip_flags
& RADEON_CHIPSET_TCL
) {
539 rmesa
->radeon
.radeonScreen
->chip_flags
&= ~RADEON_CHIPSET_TCL
;
540 fprintf(stderr
, "Disabling HW TCL support\n");
542 TCL_FALLBACK(rmesa
->radeon
.glCtx
, R200_TCL_FALLBACK_TCL_DISABLE
, 1);
549 /* Destroy the device specific context.
551 /* Destroy the Mesa and driver specific context data.
553 void r200DestroyContext( __DRIcontextPrivate
*driContextPriv
)
555 GET_CURRENT_CONTEXT(ctx
);
556 r200ContextPtr rmesa
= (r200ContextPtr
) driContextPriv
->driverPrivate
;
557 r200ContextPtr current
= ctx
? R200_CONTEXT(ctx
) : NULL
;
559 /* check if we're deleting the currently bound context */
560 if (rmesa
== current
) {
561 R200_FIREVERTICES( rmesa
);
562 _mesa_make_current(NULL
, NULL
, NULL
);
565 /* Free r200 context resources */
566 assert(rmesa
); /* should never be null */
568 GLboolean release_texture_heaps
;
571 release_texture_heaps
= (rmesa
->radeon
.glCtx
->Shared
->RefCount
== 1);
572 _swsetup_DestroyContext( rmesa
->radeon
.glCtx
);
573 _tnl_DestroyContext( rmesa
->radeon
.glCtx
);
574 _vbo_DestroyContext( rmesa
->radeon
.glCtx
);
575 _swrast_DestroyContext( rmesa
->radeon
.glCtx
);
577 r200DestroySwtcl( rmesa
->radeon
.glCtx
);
578 r200ReleaseArrays( rmesa
->radeon
.glCtx
, ~0 );
580 if (rmesa
->dma
.current
.buf
) {
581 // r200ReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ );
582 rcommonFlushCmdBuf( &rmesa
->radeon
, __FUNCTION__
);
585 if (rmesa
->radeon
.state
.scissor
.pClipRects
) {
586 FREE(rmesa
->radeon
.state
.scissor
.pClipRects
);
587 rmesa
->radeon
.state
.scissor
.pClipRects
= NULL
;
591 if ( release_texture_heaps
) {
592 /* This share group is about to go away, free our private
593 * texture object data.
597 for ( i
= 0 ; i
< rmesa
->radeon
.nr_heaps
; i
++ ) {
598 driDestroyTextureHeap( rmesa
->radeon
.texture_heaps
[ i
] );
599 rmesa
->radeon
.texture_heaps
[ i
] = NULL
;
602 assert( is_empty_list( & rmesa
->radeon
.swapped
) );
605 radeonCleanupContext(&rmesa
->radeon
);
613 /* Force the context `c' to be unbound from its buffer.
616 r200UnbindContext( __DRIcontextPrivate
*driContextPriv
)
618 r200ContextPtr rmesa
= (r200ContextPtr
) driContextPriv
->driverPrivate
;
620 if (R200_DEBUG
& DEBUG_DRI
)
621 fprintf(stderr
, "%s ctx %p\n", __FUNCTION__
, (void *)rmesa
->radeon
.glCtx
);