From: Joakim Plate Subject: RFC: Change =?utf-8?b?T01MX3N5bmNfY29udHJvbA==?= UST to =?utf-8?b?Q0xPQ0tfTU9OT1RPTklD?= Date: Sun, 10 Jun 2012 11:56:34 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by gabe.freedesktop.org (Postfix) with ESMTP id C4C569E779 for ; Sun, 10 Jun 2012 04:56:53 -0700 (PDT) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SdglA-0000a2-9i for dri-devel@lists.freedesktop.org; Sun, 10 Jun 2012 13:56:44 +0200 Received: from 104.9.95.91.static.g-va.siw.siwnet.net ([91.95.9.104]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 10 Jun 2012 13:56:44 +0200 Received: from elupus by 104.9.95.91.static.g-va.siw.siwnet.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 10 Jun 2012 13:56:44 +0200 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Hi, I'm currently trying to make use of OML_sync_control extension to schedule presentation of video frames in xbmc. I've run into somewhat of a snag. It seem the spec doesn't specify what time the UST clock really is, nor can i find any mention of it elsewhere in docs. Code wise it seem to be using do_gettimeofday(), which seems like a rather poor choice given that it can jump forward and back in time due to settimeofday calls. We normally make use of clock_gettime(CLOCK_MONOTONIC) to timestamp display of video frames, so to avoid major changes I'd need a way to convert to gettimeofday (seem same as CLOCK_REALTIME). Currently i'm trying: struct timespec mon, rel; clock_gettime(CLOCK_MONOTONIC, &mon); clock_gettime(CLOCK_REALTIME , &rel); ticks += (rel.tv_sec - mon.tv_sec) * 1000000000; ticks += (rel.tv_nsec - mon.tv_nsec); To convert between the two, but that is quite a hack both in the possibility of clock changes and scheduling errors. Is there a better way, or perhaps the DRI code should use CLOCK_MONOTONIC in the first place? Regards /Joakim