1 /**************************************************************************
3 Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
4 VA Linux Systems Inc., Fremont, California.
5 Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
7 The Weather Channel (TM) funded Tungsten Graphics to develop the
8 initial release of the Radeon 8500 driver under the XFree86 license.
9 This notice must be preserved.
13 Permission is hereby granted, free of charge, to any person obtaining
14 a copy of this software and associated documentation files (the
15 "Software"), to deal in the Software without restriction, including
16 without limitation the rights to use, copy, modify, merge, publish,
17 distribute, sublicense, and/or sell copies of the Software, and to
18 permit persons to whom the Software is furnished to do so, subject to
19 the following conditions:
21 The above copyright notice and this permission notice (including the
22 next paragraph) shall be included in all copies or substantial
23 portions of the Software.
25 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
28 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
29 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 **************************************************************************/
35 #include "radeon_common.h"
36 #include "xmlpool.h" /* for symbolic values of enum-type options */
39 #include "drirenderbuffer.h"
40 #include "main/context.h"
41 #include "main/framebuffer.h"
42 #include "main/renderbuffer.h"
43 #include "main/state.h"
44 #include "main/simple_list.h"
45 #include "swrast/swrast.h"
46 #include "swrast_setup/swrast_setup.h"
49 #define DRIVER_DATE "20090101"
52 int RADEON_DEBUG
= (0);
55 /* Return various strings for glGetString().
57 static const GLubyte
*radeonGetString(GLcontext
* ctx
, GLenum name
)
59 radeonContextPtr radeon
= RADEON_CONTEXT(ctx
);
60 static char buffer
[128];
64 if (IS_R300_CLASS(radeon
->radeonScreen
))
65 return (GLubyte
*) "DRI R300 Project";
67 return (GLubyte
*) "Tungsten Graphics, Inc.";
72 GLuint agp_mode
= (radeon
->radeonScreen
->card_type
==RADEON_CARD_PCI
) ? 0 :
73 radeon
->radeonScreen
->AGPMode
;
76 if (IS_R300_CLASS(radeon
->radeonScreen
))
78 else if (IS_R200_CLASS(radeon
->radeonScreen
))
83 offset
= driGetRendererString(buffer
, chipname
, DRIVER_DATE
,
86 if (IS_R300_CLASS(radeon
->radeonScreen
)) {
87 sprintf(&buffer
[offset
], " %sTCL",
88 (radeon
->radeonScreen
->chip_flags
& RADEON_CHIPSET_TCL
)
91 sprintf(&buffer
[offset
], " %sTCL",
92 !(radeon
->TclFallback
& RADEON_TCL_FALLBACK_TCL_DISABLE
)
96 if (radeon
->radeonScreen
->driScreen
->dri2
.enabled
)
97 strcat(buffer
, " DRI2");
99 return (GLubyte
*) buffer
;
107 /* Initialize the driver's misc functions.
109 static void radeonInitDriverFuncs(struct dd_function_table
*functions
)
111 functions
->GetString
= radeonGetString
;
115 * Create and initialize all common fields of the context,
116 * including the Mesa context itself.
118 GLboolean
radeonInitContext(radeonContextPtr radeon
,
119 struct dd_function_table
* functions
,
120 const __GLcontextModes
* glVisual
,
121 __DRIcontextPrivate
* driContextPriv
,
122 void *sharedContextPrivate
)
124 __DRIscreenPrivate
*sPriv
= driContextPriv
->driScreenPriv
;
125 radeonScreenPtr screen
= (radeonScreenPtr
) (sPriv
->private);
130 /* Fill in additional standard functions. */
131 radeonInitDriverFuncs(functions
);
133 radeon
->radeonScreen
= screen
;
134 /* Allocate and initialize the Mesa context */
135 if (sharedContextPrivate
)
136 shareCtx
= ((radeonContextPtr
)sharedContextPrivate
)->glCtx
;
139 radeon
->glCtx
= _mesa_create_context(glVisual
, shareCtx
,
140 functions
, (void *)radeon
);
145 driContextPriv
->driverPrivate
= radeon
;
148 radeon
->dri
.context
= driContextPriv
;
149 radeon
->dri
.screen
= sPriv
;
150 radeon
->dri
.drawable
= NULL
;
151 radeon
->dri
.readable
= NULL
;
152 radeon
->dri
.hwContext
= driContextPriv
->hHWContext
;
153 radeon
->dri
.hwLock
= &sPriv
->pSAREA
->lock
;
154 radeon
->dri
.fd
= sPriv
->fd
;
155 radeon
->dri
.drmMinor
= sPriv
->drm_version
.minor
;
157 radeon
->sarea
= (drm_radeon_sarea_t
*) ((GLubyte
*) sPriv
->pSAREA
+
158 screen
->sarea_priv_offset
);
161 fthrottle_mode
= driQueryOptioni(&radeon
->optionCache
, "fthrottle_mode");
162 radeon
->iw
.irq_seq
= -1;
163 radeon
->irqsEmitted
= 0;
164 radeon
->do_irqs
= (fthrottle_mode
== DRI_CONF_FTHROTTLE_IRQS
&&
165 radeon
->radeonScreen
->irq
);
167 radeon
->do_usleeps
= (fthrottle_mode
== DRI_CONF_FTHROTTLE_USLEEPS
);
169 if (!radeon
->do_irqs
)
171 "IRQ's not enabled, falling back to %s: %d %d\n",
172 radeon
->do_usleeps
? "usleeps" : "busy waits",
173 fthrottle_mode
, radeon
->radeonScreen
->irq
);
175 radeon
->texture_depth
= driQueryOptioni (&radeon
->optionCache
,
177 if (radeon
->texture_depth
== DRI_CONF_TEXTURE_DEPTH_FB
)
178 radeon
->texture_depth
= ( glVisual
->rgbBits
> 16 ) ?
179 DRI_CONF_TEXTURE_DEPTH_32
: DRI_CONF_TEXTURE_DEPTH_16
;
181 radeon
->texture_row_align
= 32;
189 * Destroy the command buffer and state atoms.
191 static void radeon_destroy_atom_list(radeonContextPtr radeon
)
193 struct radeon_state_atom
*atom
;
195 foreach(atom
, &radeon
->hw
.atomlist
) {
204 * Cleanup common context fields.
205 * Called by r200DestroyContext/r300DestroyContext
207 void radeonDestroyContext(__DRIcontextPrivate
*driContextPriv
)
209 #ifdef RADEON_BO_TRACK
212 GET_CURRENT_CONTEXT(ctx
);
213 radeonContextPtr radeon
= (radeonContextPtr
) driContextPriv
->driverPrivate
;
214 radeonContextPtr current
= ctx
? RADEON_CONTEXT(ctx
) : NULL
;
216 if (radeon
== current
) {
217 radeon_firevertices(radeon
);
218 _mesa_make_current(NULL
, NULL
, NULL
);
224 if (radeon
->dma
.current
) {
225 rcommonFlushCmdBuf( radeon
, __FUNCTION__
);
228 radeonReleaseArrays(radeon
->glCtx
, ~0);
230 if (radeon
->vtbl
.free_context
)
231 radeon
->vtbl
.free_context(radeon
->glCtx
);
232 _swsetup_DestroyContext( radeon
->glCtx
);
233 _tnl_DestroyContext( radeon
->glCtx
);
234 _vbo_DestroyContext( radeon
->glCtx
);
235 _swrast_DestroyContext( radeon
->glCtx
);
237 radeonDestroyBuffer(radeon
->dri
.drawable
);
238 radeonDestroyBuffer(radeon
->dri
.readable
);
241 /* free the Mesa context */
242 _mesa_destroy_context(radeon
->glCtx
);
244 /* _mesa_destroy_context() might result in calls to functions that
245 * depend on the DriverCtx, so don't set it to NULL before.
247 * radeon->glCtx->DriverCtx = NULL;
249 /* free the option cache */
250 driDestroyOptionCache(&radeon
->optionCache
);
252 rcommonDestroyCmdBuf(radeon
);
254 radeon_destroy_atom_list(radeon
);
256 if (radeon
->state
.scissor
.pClipRects
) {
257 FREE(radeon
->state
.scissor
.pClipRects
);
258 radeon
->state
.scissor
.pClipRects
= 0;
261 #ifdef RADEON_BO_TRACK
262 track
= fopen("/tmp/tracklog", "w");
264 radeon_tracker_print(&radeon
->radeonScreen
->bom
->tracker
, track
);
271 /* Force the context `c' to be unbound from its buffer.
273 GLboolean
radeonUnbindContext(__DRIcontextPrivate
* driContextPriv
)
275 radeonContextPtr radeon
= (radeonContextPtr
) driContextPriv
->driverPrivate
;
277 if (RADEON_DEBUG
& DEBUG_DRI
)
278 fprintf(stderr
, "%s ctx %p\n", __FUNCTION__
,
286 radeon_make_kernel_renderbuffer_current(radeonContextPtr radeon
,
287 struct radeon_framebuffer
*draw
)
289 /* if radeon->fake */
290 struct radeon_renderbuffer
*rb
;
292 if ((rb
= (void *)draw
->base
.Attachment
[BUFFER_FRONT_LEFT
].Renderbuffer
)) {
294 rb
->bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
295 radeon
->radeonScreen
->frontOffset
,
298 RADEON_GEM_DOMAIN_VRAM
,
301 rb
->cpp
= radeon
->radeonScreen
->cpp
;
302 rb
->pitch
= radeon
->radeonScreen
->frontPitch
* rb
->cpp
;
304 if ((rb
= (void *)draw
->base
.Attachment
[BUFFER_BACK_LEFT
].Renderbuffer
)) {
306 rb
->bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
307 radeon
->radeonScreen
->backOffset
,
310 RADEON_GEM_DOMAIN_VRAM
,
313 rb
->cpp
= radeon
->radeonScreen
->cpp
;
314 rb
->pitch
= radeon
->radeonScreen
->backPitch
* rb
->cpp
;
316 if ((rb
= (void *)draw
->base
.Attachment
[BUFFER_DEPTH
].Renderbuffer
)) {
318 rb
->bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
319 radeon
->radeonScreen
->depthOffset
,
322 RADEON_GEM_DOMAIN_VRAM
,
325 rb
->cpp
= radeon
->radeonScreen
->cpp
;
326 rb
->pitch
= radeon
->radeonScreen
->depthPitch
* rb
->cpp
;
328 if ((rb
= (void *)draw
->base
.Attachment
[BUFFER_STENCIL
].Renderbuffer
)) {
330 rb
->bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
331 radeon
->radeonScreen
->depthOffset
,
334 RADEON_GEM_DOMAIN_VRAM
,
337 rb
->cpp
= radeon
->radeonScreen
->cpp
;
338 rb
->pitch
= radeon
->radeonScreen
->depthPitch
* rb
->cpp
;
343 radeon_make_renderbuffer_current(radeonContextPtr radeon
,
344 struct radeon_framebuffer
*draw
)
346 int size
= 4096*4096*4;
347 /* if radeon->fake */
348 struct radeon_renderbuffer
*rb
;
350 if (radeon
->radeonScreen
->kernel_mm
) {
351 radeon_make_kernel_renderbuffer_current(radeon
, draw
);
356 if ((rb
= (void *)draw
->base
.Attachment
[BUFFER_FRONT_LEFT
].Renderbuffer
)) {
358 rb
->bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
359 radeon
->radeonScreen
->frontOffset
+
360 radeon
->radeonScreen
->fbLocation
,
363 RADEON_GEM_DOMAIN_VRAM
,
366 rb
->cpp
= radeon
->radeonScreen
->cpp
;
367 rb
->pitch
= radeon
->radeonScreen
->frontPitch
* rb
->cpp
;
369 if ((rb
= (void *)draw
->base
.Attachment
[BUFFER_BACK_LEFT
].Renderbuffer
)) {
371 rb
->bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
372 radeon
->radeonScreen
->backOffset
+
373 radeon
->radeonScreen
->fbLocation
,
376 RADEON_GEM_DOMAIN_VRAM
,
379 rb
->cpp
= radeon
->radeonScreen
->cpp
;
380 rb
->pitch
= radeon
->radeonScreen
->backPitch
* rb
->cpp
;
382 if ((rb
= (void *)draw
->base
.Attachment
[BUFFER_DEPTH
].Renderbuffer
)) {
384 rb
->bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
385 radeon
->radeonScreen
->depthOffset
+
386 radeon
->radeonScreen
->fbLocation
,
389 RADEON_GEM_DOMAIN_VRAM
,
392 rb
->cpp
= radeon
->radeonScreen
->cpp
;
393 rb
->pitch
= radeon
->radeonScreen
->depthPitch
* rb
->cpp
;
395 if ((rb
= (void *)draw
->base
.Attachment
[BUFFER_STENCIL
].Renderbuffer
)) {
397 rb
->bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
398 radeon
->radeonScreen
->depthOffset
+
399 radeon
->radeonScreen
->fbLocation
,
402 RADEON_GEM_DOMAIN_VRAM
,
405 rb
->cpp
= radeon
->radeonScreen
->cpp
;
406 rb
->pitch
= radeon
->radeonScreen
->depthPitch
* rb
->cpp
;
411 radeon_bits_per_pixel(const struct radeon_renderbuffer
*rb
)
413 switch (rb
->base
._ActualFormat
) {
415 case GL_DEPTH_COMPONENT16
:
419 case GL_DEPTH_COMPONENT24
:
420 case GL_DEPTH24_STENCIL8_EXT
:
421 case GL_STENCIL_INDEX8_EXT
:
429 radeon_update_renderbuffers(__DRIcontext
*context
, __DRIdrawable
*drawable
)
431 unsigned int attachments
[10];
432 __DRIbuffer
*buffers
= NULL
;
434 struct radeon_renderbuffer
*rb
;
436 struct radeon_framebuffer
*draw
;
437 radeonContextPtr radeon
;
439 struct radeon_bo
*depth_bo
= NULL
, *bo
;
441 if (RADEON_DEBUG
& DEBUG_DRI
)
442 fprintf(stderr
, "enter %s, drawable %p\n", __func__
, drawable
);
444 draw
= drawable
->driverPrivate
;
445 screen
= context
->driScreenPriv
;
446 radeon
= (radeonContextPtr
) context
->driverPrivate
;
448 if (screen
->dri2
.loader
449 && (screen
->dri2
.loader
->base
.version
> 2)
450 && (screen
->dri2
.loader
->getBuffersWithFormat
!= NULL
)) {
451 struct radeon_renderbuffer
*depth_rb
;
452 struct radeon_renderbuffer
*stencil_rb
;
455 if ((radeon
->is_front_buffer_rendering
|| !draw
->color_rb
[1])
456 && draw
->color_rb
[0]) {
457 attachments
[i
++] = __DRI_BUFFER_FRONT_LEFT
;
458 attachments
[i
++] = radeon_bits_per_pixel(draw
->color_rb
[0]);
461 if (draw
->color_rb
[1]) {
462 attachments
[i
++] = __DRI_BUFFER_BACK_LEFT
;
463 attachments
[i
++] = radeon_bits_per_pixel(draw
->color_rb
[1]);
466 depth_rb
= radeon_get_renderbuffer(&draw
->base
, BUFFER_DEPTH
);
467 stencil_rb
= radeon_get_renderbuffer(&draw
->base
, BUFFER_STENCIL
);
469 if ((depth_rb
!= NULL
) && (stencil_rb
!= NULL
)) {
470 attachments
[i
++] = __DRI_BUFFER_DEPTH_STENCIL
;
471 attachments
[i
++] = radeon_bits_per_pixel(depth_rb
);
472 } else if (depth_rb
!= NULL
) {
473 attachments
[i
++] = __DRI_BUFFER_DEPTH
;
474 attachments
[i
++] = radeon_bits_per_pixel(depth_rb
);
475 } else if (stencil_rb
!= NULL
) {
476 attachments
[i
++] = __DRI_BUFFER_STENCIL
;
477 attachments
[i
++] = radeon_bits_per_pixel(stencil_rb
);
480 buffers
= (*screen
->dri2
.loader
->getBuffersWithFormat
)(drawable
,
485 drawable
->loaderPrivate
);
486 } else if (screen
->dri2
.loader
) {
488 if (draw
->color_rb
[0])
489 attachments
[i
++] = __DRI_BUFFER_FRONT_LEFT
;
490 if (draw
->color_rb
[1])
491 attachments
[i
++] = __DRI_BUFFER_BACK_LEFT
;
492 if (radeon_get_renderbuffer(&draw
->base
, BUFFER_DEPTH
))
493 attachments
[i
++] = __DRI_BUFFER_DEPTH
;
494 if (radeon_get_renderbuffer(&draw
->base
, BUFFER_STENCIL
))
495 attachments
[i
++] = __DRI_BUFFER_STENCIL
;
497 buffers
= (*screen
->dri2
.loader
->getBuffers
)(drawable
,
502 drawable
->loaderPrivate
);
508 /* set one cliprect to cover the whole drawable */
513 drawable
->numClipRects
= 1;
514 drawable
->pClipRects
[0].x1
= 0;
515 drawable
->pClipRects
[0].y1
= 0;
516 drawable
->pClipRects
[0].x2
= drawable
->w
;
517 drawable
->pClipRects
[0].y2
= drawable
->h
;
518 drawable
->numBackClipRects
= 1;
519 drawable
->pBackClipRects
[0].x1
= 0;
520 drawable
->pBackClipRects
[0].y1
= 0;
521 drawable
->pBackClipRects
[0].x2
= drawable
->w
;
522 drawable
->pBackClipRects
[0].y2
= drawable
->h
;
523 for (i
= 0; i
< count
; i
++) {
524 switch (buffers
[i
].attachment
) {
525 case __DRI_BUFFER_FRONT_LEFT
:
526 rb
= draw
->color_rb
[0];
527 regname
= "dri2 front buffer";
529 case __DRI_BUFFER_FAKE_FRONT_LEFT
:
530 rb
= draw
->color_rb
[0];
531 regname
= "dri2 fake front buffer";
533 case __DRI_BUFFER_BACK_LEFT
:
534 rb
= draw
->color_rb
[1];
535 regname
= "dri2 back buffer";
537 case __DRI_BUFFER_DEPTH
:
538 rb
= radeon_get_renderbuffer(&draw
->base
, BUFFER_DEPTH
);
539 regname
= "dri2 depth buffer";
541 case __DRI_BUFFER_DEPTH_STENCIL
:
542 rb
= radeon_get_renderbuffer(&draw
->base
, BUFFER_DEPTH
);
543 regname
= "dri2 depth / stencil buffer";
545 case __DRI_BUFFER_STENCIL
:
546 rb
= radeon_get_renderbuffer(&draw
->base
, BUFFER_STENCIL
);
547 regname
= "dri2 stencil buffer";
549 case __DRI_BUFFER_ACCUM
:
552 "unhandled buffer attach event, attacment type %d\n",
553 buffers
[i
].attachment
);
561 uint32_t name
= radeon_gem_name_bo(rb
->bo
);
562 if (name
== buffers
[i
].name
)
566 if (RADEON_DEBUG
& DEBUG_DRI
)
568 "attaching buffer %s, %d, at %d, cpp %d, pitch %d\n",
569 regname
, buffers
[i
].name
, buffers
[i
].attachment
,
570 buffers
[i
].cpp
, buffers
[i
].pitch
);
572 rb
->cpp
= buffers
[i
].cpp
;
573 rb
->pitch
= buffers
[i
].pitch
;
574 rb
->width
= drawable
->w
;
575 rb
->height
= drawable
->h
;
578 if (buffers
[i
].attachment
== __DRI_BUFFER_STENCIL
&& depth_bo
) {
579 if (RADEON_DEBUG
& DEBUG_DRI
)
580 fprintf(stderr
, "(reusing depth buffer as stencil)\n");
584 bo
= radeon_bo_open(radeon
->radeonScreen
->bom
,
588 RADEON_GEM_DOMAIN_VRAM
,
592 fprintf(stderr
, "failed to attach %s %d\n",
593 regname
, buffers
[i
].name
);
598 if (buffers
[i
].attachment
== __DRI_BUFFER_DEPTH
) {
599 if (draw
->base
.Visual
.depthBits
== 16)
604 radeon_renderbuffer_set_bo(rb
, bo
);
607 if (buffers
[i
].attachment
== __DRI_BUFFER_DEPTH_STENCIL
) {
608 rb
= radeon_get_renderbuffer(&draw
->base
, BUFFER_STENCIL
);
610 struct radeon_bo
*stencil_bo
= NULL
;
613 uint32_t name
= radeon_gem_name_bo(rb
->bo
);
614 if (name
== buffers
[i
].name
)
619 radeon_bo_ref(stencil_bo
);
620 radeon_renderbuffer_set_bo(rb
, stencil_bo
);
621 radeon_bo_unref(stencil_bo
);
626 driUpdateFramebufferSize(radeon
->glCtx
, drawable
);
629 /* Force the context `c' to be the current context and associate with it
632 GLboolean
radeonMakeCurrent(__DRIcontextPrivate
* driContextPriv
,
633 __DRIdrawablePrivate
* driDrawPriv
,
634 __DRIdrawablePrivate
* driReadPriv
)
636 radeonContextPtr radeon
;
637 struct radeon_framebuffer
*drfb
;
638 struct gl_framebuffer
*readfb
;
640 if (!driContextPriv
) {
641 if (RADEON_DEBUG
& DEBUG_DRI
)
642 fprintf(stderr
, "%s ctx is null\n", __FUNCTION__
);
643 _mesa_make_current(NULL
, NULL
, NULL
);
647 radeon
= (radeonContextPtr
) driContextPriv
->driverPrivate
;
648 drfb
= driDrawPriv
->driverPrivate
;
649 readfb
= driReadPriv
->driverPrivate
;
651 if (driContextPriv
->driScreenPriv
->dri2
.enabled
) {
652 radeon_update_renderbuffers(driContextPriv
, driDrawPriv
);
653 if (driDrawPriv
!= driReadPriv
)
654 radeon_update_renderbuffers(driContextPriv
, driReadPriv
);
655 _mesa_reference_renderbuffer(&radeon
->state
.color
.rb
,
656 &(radeon_get_renderbuffer(&drfb
->base
, BUFFER_BACK_LEFT
)->base
));
657 _mesa_reference_renderbuffer(&radeon
->state
.depth
.rb
,
658 &(radeon_get_renderbuffer(&drfb
->base
, BUFFER_DEPTH
)->base
));
660 radeon_make_renderbuffer_current(radeon
, drfb
);
664 if (RADEON_DEBUG
& DEBUG_DRI
)
665 fprintf(stderr
, "%s ctx %p dfb %p rfb %p\n", __FUNCTION__
, radeon
->glCtx
, drfb
, readfb
);
667 if (radeon
->dri
.readable
!= driReadPriv
)
668 radeon
->dri
.readable
= driReadPriv
;
670 driUpdateFramebufferSize(radeon
->glCtx
, driDrawPriv
);
671 if (driReadPriv
!= driDrawPriv
)
672 driUpdateFramebufferSize(radeon
->glCtx
, driReadPriv
);
674 _mesa_make_current(radeon
->glCtx
, &drfb
->base
, readfb
);
676 _mesa_update_state(radeon
->glCtx
);
678 if (radeon
->glCtx
->DrawBuffer
== &drfb
->base
) {
680 if (radeon
->dri
.drawable
!= driDrawPriv
) {
681 if (driDrawPriv
->swap_interval
== (unsigned)-1) {
683 driDrawPriv
->vblFlags
=
684 (radeon
->radeonScreen
->irq
!= 0)
685 ? driGetDefaultVBlankFlags(&radeon
->
687 : VBLANK_FLAG_NO_IRQ
;
689 driDrawableInitVBlank(driDrawPriv
);
690 drfb
->vbl_waited
= driDrawPriv
->vblSeq
;
692 for (i
= 0; i
< 2; i
++) {
693 if (drfb
->color_rb
[i
])
694 drfb
->color_rb
[i
]->vbl_pending
= driDrawPriv
->vblSeq
;
698 radeon
->dri
.drawable
= driDrawPriv
;
700 radeon_window_moved(radeon
);
702 radeon_draw_buffer(radeon
->glCtx
, &drfb
->base
);
706 if (RADEON_DEBUG
& DEBUG_DRI
)
707 fprintf(stderr
, "End %s\n", __FUNCTION__
);