Ticket #54236: patch-support-egl_dri2.diff
File patch-support-egl_dri2.diff, 1.5 KB (added by RJVB (René Bertin), 7 years ago) |
---|
-
src/egl/drivers/dri2/
old new 58 58 #include "egl_dri2.h" 59 59 #include "util/u_atomic.h" 60 60 61 #ifdef __MACH__ 62 #include <mach/mach.h> 63 #include <mach/mach_time.h> 64 #include <sys/sysctl.h> 65 #endif 66 61 67 /* The kernel header drm_fourcc.h defines the DRM formats below. We duplicate 62 68 * some of the definitions here so that building Mesa won't bleeding-edge 63 69 * kernel headers. … … 2475 2481 return NULL; 2476 2482 } 2477 2483 2484 #ifndef __MACH__ 2478 2485 /* change clock attribute to CLOCK_MONOTONIC */ 2479 2486 ret = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); 2487 #endif 2480 2488 2481 2489 if (ret) { 2482 2490 _eglError(EGL_BAD_ACCESS, "eglCreateSyncKHR"); … … 2594 2602 } else { 2595 2603 /* if reusable sync has not been yet signaled */ 2596 2604 if (dri2_sync->base.SyncStatus != EGL_SIGNALED_KHR) { 2605 #ifndef __MACH__ 2597 2606 clock_gettime(CLOCK_MONOTONIC, ¤t); 2607 #else 2608 static int calibrated = 0; 2609 static mach_timebase_info_data_t sTimebaseInfo; 2610 if (!calibrated) { 2611 mach_timebase_info(&sTimebaseInfo); 2612 calibrated = 1; 2613 } 2614 unsigned long long now = mach_absolute_time() * sTimebaseInfo.numer / sTimebaseInfo.denom; 2615 current.tv_sec = now / 1000000000; 2616 current.tv_nsec = now % 1000000000; 2617 #endif 2598 2618 2599 2619 /* calculating when to expire */ 2600 2620 expire.nsec = timeout % 1000000000L;