00f0e7506f4c3d2a1d61a59d6a2356243c6ccd8b
1 /* -*- mode: c; c-basic-offset: 3 -*- */
3 * (c) Copyright IBM Corporation 2002
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * on the rights to use, copy, modify, merge, publish, distribute, sub
10 * license, and/or sell copies of the Software, and to permit persons to whom
11 * the Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
23 * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 * Ian Romanick <idr@us.ibm.com>
35 #include "xmlconfig.h"
37 #define VBLANK_FLAG_INTERVAL (1U << 0) /* Respect the swap_interval setting
39 #define VBLANK_FLAG_THROTTLE (1U << 1) /* Wait 1 refresh since last call.
41 #define VBLANK_FLAG_SYNC (1U << 2) /* Sync to the next refresh.
43 #define VBLANK_FLAG_NO_IRQ (1U << 7) /* DRM has no IRQ to wait on.
45 #define VBLANK_FLAG_SECONDARY (1U << 8) /* Wait for secondary vblank.
48 extern int driGetMSC32( __DRIscreenPrivate
* priv
, int64_t * count
);
49 extern int driWaitForMSC32( __DRIdrawablePrivate
*priv
,
50 int64_t target_msc
, int64_t divisor
, int64_t remainder
, int64_t * msc
);
51 extern GLuint
driGetDefaultVBlankFlags( const driOptionCache
*optionCache
);
52 extern void driDrawableInitVBlank ( __DRIdrawablePrivate
*priv
, GLuint flags
,
54 extern unsigned driGetVBlankInterval( const __DRIdrawablePrivate
*priv
,
56 extern int driWaitForVBlank( const __DRIdrawablePrivate
*priv
,
57 GLuint
* vbl_seq
, GLuint flags
, GLboolean
* missed_deadline
);
60 #include <unistd.h> /* for usleep() */
61 #include <sched.h> /* for sched_yield() */
64 #include <sched.h> /* for sched_yield() */
67 #define DO_USLEEP(nr) \
69 if (0) fprintf(stderr, "%s: usleep for %u\n", __FUNCTION__, nr ); \
70 if (1) usleep( nr ); \
74 #endif /* DRI_VBLANK_H */