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  
    5858#include "egl_dri2.h"
    5959#include "util/u_atomic.h"
    6060
     61#ifdef __MACH__
     62#include <mach/mach.h>
     63#include <mach/mach_time.h>
     64#include <sys/sysctl.h>
     65#endif
     66
    6167/* The kernel header drm_fourcc.h defines the DRM formats below.  We duplicate
    6268 * some of the definitions here so that building Mesa won't bleeding-edge
    6369 * kernel headers.
     
    24752481         return NULL;
    24762482      }
    24772483
     2484#ifndef __MACH__
    24782485      /* change clock attribute to CLOCK_MONOTONIC */
    24792486      ret = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
     2487#endif
    24802488
    24812489      if (ret) {
    24822490         _eglError(EGL_BAD_ACCESS, "eglCreateSyncKHR");
     
    25942602      } else {
    25952603         /* if reusable sync has not been yet signaled */
    25962604         if (dri2_sync->base.SyncStatus != EGL_SIGNALED_KHR) {
     2605#ifndef __MACH__
    25972606            clock_gettime(CLOCK_MONOTONIC, &current);
     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
    25982618
    25992619            /* calculating when to expire */
    26002620            expire.nsec = timeout % 1000000000L;