From patchwork Mon Mar 12 02:11:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 7218 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9AB1423E14 for ; Mon, 12 Mar 2012 02:11:17 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5F6E3A1823D for ; Mon, 12 Mar 2012 02:11:17 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so7948962iag.11 for ; Sun, 11 Mar 2012 19:11:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=vGuq2NqXQmbuklnq6eCKaMteqq8Gw0iPb2F482f+ddY=; b=PZWtkCEKuZsuE8MwDRn1eIarmmXeCHHoTiXgAf7tb99BF0c7imXmNXxHCVFINWc5z/ MHvpSfSOTeNgeUm18r+oJAoqDQGDiO4fcEbK8HlHRf1WpA8yuKhj9jmoAQWjjoU0jEiE KHIc5n3WmDIptev/AauxvUM/qU87qqlq1yHz7TL0otWr1UfarUaNZBNjhL9Jin9l4E+H uTIkmd2eARCsXyb0Ejxgn96JdoLnIO7oesWG6W1E8Gsdbd8c/y39KtoDsrTivMse2lzQ ZBQXbhmgZRHux3F1g3duObqFCG4NINybYFY1kQZciTUFNOo00urJD0YVf3it1pY4jmUr VWRg== Received: by 10.42.145.72 with SMTP id e8mr13335620icv.0.1331518277156; Sun, 11 Mar 2012 19:11:17 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp31437ibg; Sun, 11 Mar 2012 19:11:16 -0700 (PDT) Received: by 10.236.189.9 with SMTP id b9mr11391029yhn.48.1331518276521; Sun, 11 Mar 2012 19:11:16 -0700 (PDT) Received: from mail-yw0-f50.google.com (mail-yw0-f50.google.com [209.85.213.50]) by mx.google.com with ESMTPS id i9si5415698ang.69.2012.03.11.19.11.16 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 11 Mar 2012 19:11:16 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.213.50 as permitted sender) client-ip=209.85.213.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.213.50 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by yhjj63 with SMTP id j63so2516143yhj.37 for ; Sun, 11 Mar 2012 19:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=vGuq2NqXQmbuklnq6eCKaMteqq8Gw0iPb2F482f+ddY=; b=GlSOEAhm8PINJlf/DmJtOvaUSmqPwaQHg1F58G0ed7pAT3mQfeQ/O3MDNVRil+1vr9 kBOV87okXALiSgOUmf030dWfwZcC+ZCYz57nedAP6P198xxjqaP4PRMDG3QEJ7zCDTF0 GZjqxQQfe225mXRCUB4nOJF7Lir+uG61h/CuJOxXtGikkxBDLaeWsb6INXIbBm4opVEC J+smgAz16805yhLum1YvzeXQ31p2Ps/YrawznBOn59t9hn2PKShB5AqOn0XbsEddANax 1reUi4fhoWrWXB3NvmNdo3JMfmu/BcCl49D/TmtE3N0GtjCnqoKO+rJ5MlMpOlGyGnKk aw0g== Received: by 10.182.41.6 with SMTP id b6mr6109757obl.10.1331518276057; Sun, 11 Mar 2012 19:11:16 -0700 (PDT) Received: from localhost (ppp-70-129-134-19.dsl.rcsntx.swbell.net. [70.129.134.19]) by mx.google.com with ESMTPS id a6sm8931299oea.13.2012.03.11.19.11.15 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 11 Mar 2012 19:11:15 -0700 (PDT) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org Cc: patches@linaro.org, Greg KH , Tomi Valkeinen , Andy Gross , Rob Clark Subject: [PATCH 3/3] staging: drm/omap: use current time for page-flip event Date: Sun, 11 Mar 2012 21:11:22 -0500 Message-Id: <1331518282-6870-3-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1331518282-6870-1-git-send-email-rob.clark@linaro.org> References: <1331518282-6870-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQlUr+qh4dXpdn5Sirxc9ulK/tyZQWnwTcynpX37zBfpfmTGnEOdPuR40P1gV63qpYTXShyQ From: Rob Clark Because we don't have vblank hooked up via drm_irq (which is a bit awkward due to separation between omapdss (which knows the irq #) and omapdrm, for now use gettimeofday to have a semi-sane timestamp in the page-flip event. Otherwise apps like weston drm compositor, which use the timestamp in it's animations, get highly confused. Signed-off-by: Rob Clark --- drivers/staging/omapdrm/omap_crtc.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c index 13e3c7f..490a7f1 100644 --- a/drivers/staging/omapdrm/omap_crtc.c +++ b/drivers/staging/omapdrm/omap_crtc.c @@ -134,9 +134,19 @@ static void vblank_cb(void *arg) /* wakeup userspace */ if (event) { + do_gettimeofday(&now); + spin_lock_irqsave(&dev->event_lock, flags); + /* TODO: we can't yet use the vblank time accounting, + * because omapdss lower layer is the one that knows + * the irq # and registers the handler, which more or + * less defeats how drm_irq works.. for now just fake + * the sequence number and use gettimeofday.. + * event->event.sequence = drm_vblank_count_and_time( dev, omap_crtc->id, &now); + */ + event->event.sequence = sequence++; event->event.tv_sec = now.tv_sec; event->event.tv_usec = now.tv_usec; list_add_tail(&event->base.link,