if test x$PKG_CONFIG != xno && \
test x$video_opengl_egl = xyes && \
test x$video_opengles_v2 = xyes; then
- if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf; then
- TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf`
- TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf`
+ if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm; then
+ TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm`
+ TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland eina capi-appfw-application capi-system-system-settings ecore-input dlog ecore-imf libdrm`
video_tizen=yes
fi
fi
/* #define DEBUG_TIMERS */
-char* timer_type = "NORMAL_TIMER";
typedef struct _SDL_Timer
{
* 3. Wait until next dispatch time or new timer arrives
*/
for ( ; ; ) {
- if(SDL_strcmp(timer_type, "VSYNC_TIMER") == 0) {
+#if defined(__TIZEN__)
+ if(data->drm_fd > -1) {
if(!data->active)
break;
- if(0 == drmWaitVBlank(data->drm_fd, &(data->vblankInfo))) {
+ if(drmWaitVBlank(data->drm_fd, &(data->vblankInfo)) == 0) {
if(data->pending) {
current = data->pending;
current->callback(current->interval, current->param);
}
}
-
}
- else {
+ else
+#endif
+ {
/* Pending and freelist maintenance */
SDL_AtomicLock(&data->lock);
{
int
SDL_TimerInit(void)
{
- timer_type = getenv("SDL_TIMER_TYPE");
- if(NULL == timer_type)
- {
- timer_type = "NORMAL_TIMER";
+#if defined(__TIZEN__)
+ int vsync_timer;
+ if (getenv("SDL_VSYNC_TIMER")) {
+ vsync_timer = 1;
}
+ else {
+ vsync_timer = 0;
+ }
+
+
+#endif
SDL_TimerData *data = &SDL_timer_data;
if (!data->active) {
}
data->active = SDL_TRUE;
-
- if(SDL_strcmp(timer_type, "VSYNC_TIMER") == 0) {
+#if defined(__TIZEN__)
+ if (vsync_timer) {
const char* DRM_DEVICE = "/dev/dri/card0";
data->drm_fd = open( DRM_DEVICE, O_RDWR );
- data->vblankInfo.request.type = DRM_VBLANK_NEXTONMISS;
- data->vblankInfo.request.sequence = 0;
- data->vblankInfo.request.signal = 0;
+ if (data->drm_fd > -1) {
+ data->vblankInfo.request.type = DRM_VBLANK_NEXTONMISS;
+ data->vblankInfo.request.sequence = 0;
+ data->vblankInfo.request.signal = 0;
- data->vblankInfo.reply.type = DRM_VBLANK_NEXTONMISS;
- data->vblankInfo.reply.sequence = 0;
- data->vblankInfo.reply.tval_sec = 0;
- data->vblankInfo.reply.tval_usec = 0;
+ data->vblankInfo.reply.type = DRM_VBLANK_NEXTONMISS;
+ data->vblankInfo.reply.sequence = 0;
+ data->vblankInfo.reply.tval_sec = 0;
+ data->vblankInfo.reply.tval_usec = 0;
+ }
}
+ else {
+ data->drm_fd = -1;
+ }
+#endif
/* !!! FIXME: this is nasty. */
#if defined(__WIN32__) && !defined(HAVE_LIBC)
#undef SDL_CreateThread