From patchwork Mon Oct 8 19:50:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 12053 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 7EB0B23FB3 for ; Mon, 8 Oct 2012 19:51:34 +0000 (UTC) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by fiordland.canonical.com (Postfix) with ESMTP id 1BAACA18BDA for ; Mon, 8 Oct 2012 19:51:33 +0000 (UTC) Received: by mail-pb0-f52.google.com with SMTP id rr13so4871250pbb.11 for ; Mon, 08 Oct 2012 12:51:33 -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=UmfgqagsyM3IbOILvl+v8eVAr6lPl5VWEuPJ2sLhnXE=; b=CV7OZNSbGp2zy+w7rO9bEyu6JYsYU+DaHAr0omt49iH/9Fuo6O8kCSO5TktzkalOCg 65UlQ8hDRp8duXIuQnJENNRPMIMT2ijS6RNulmpkYC6TpbnxnnnrSQxRsz2TjElBfgLx +uxL9Miisu9SdmWT7WC+QDytvvCZYX6BOjB6sXoBybzyplL4LuUubQM44QvTlAGbGJLt iBV2dL6wgEKguhbRyZSw+TtP1pVpTTAJiFiamiJjE3lhM4U6/QnkqSlkqGaoyXikq6I4 eE5AcQ01BiETurG69vCorrJ12LtNa1f9wysyhX8G3sOfoGl1JBLsv7f9XF/ZeX9mmwAp sYmg== Received: by 10.68.212.71 with SMTP id ni7mr55602726pbc.81.1349725893841; Mon, 08 Oct 2012 12:51:33 -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.68.34.137 with SMTP id z9csp314547pbi; Mon, 8 Oct 2012 12:51:33 -0700 (PDT) Received: by 10.182.8.10 with SMTP id n10mr1015585oba.19.1349725893067; Mon, 08 Oct 2012 12:51:33 -0700 (PDT) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id b5si4948733obl.208.2012.10.08.12.51.32 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 12:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.214.178 as permitted sender) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.214.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-ob0-f178.google.com with SMTP id tb18so4877681obb.37 for ; Mon, 08 Oct 2012 12:51:32 -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=UmfgqagsyM3IbOILvl+v8eVAr6lPl5VWEuPJ2sLhnXE=; b=cccYtW9pw620FghMhdFWl8061+CmuyFmLqVc4CzdpqgXpmg2R4MT4G7/NgIVULrDG/ LjW48h/7Hq/Q2TA9GJshSocz7cYB6WX2x75shwN8KGfo4Rt3C3ZmLAjEnlv57j8SxrLB 2GreeGhQCGqmPk4ibD9/E5bnwP9Bm0YOSRniNibnYzrv5YfEG48t4tYGLBBArjTf3pXg S66+MoQNM3bGEo1i9rrzJwR0zMKdzFueCmgrCIFoJMLgTIMS9I47NAy7Iqlmxgp8FirJ hM+myyupqQZQtd8k3iO2yDsqvL3uGeUZYZN/WNjuKJjNc5aHY2JzkBOkja2qSWqpWBpZ q55w== Received: by 10.60.0.169 with SMTP id 9mr14295686oef.94.1349725892729; Mon, 08 Oct 2012 12:51:32 -0700 (PDT) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id 4sm14929154oew.10.2012.10.08.12.51.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 12:51:32 -0700 (PDT) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, airlied@linux.ie, daniel.vetter@ffwll.ch, bskeggs@redhat.com, inki.dae@samsung.com, laurent.pinchart@ideasonboard.com, s.hauer@pengutronix.de, gregkh@linuxfoundation.org, Rob Clark Subject: [PATCH 10/11] drm/omap: use drm_send_vblank_event() helper Date: Mon, 8 Oct 2012 14:50:48 -0500 Message-Id: <1349725849-22433-11-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349725849-22433-1-git-send-email-rob.clark@linaro.org> References: <1349725849-22433-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQncq4U8MPgXdQvGY1PAs78HcpE+SdbTHGPeoQ16RKPTe9/cCcyBR4+gS5SgOmMm/PRFmTHX From: Rob Clark Signed-off-by: Rob Clark --- drivers/staging/omapdrm/omap_crtc.c | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c index 732f2ad..74e019a 100644 --- a/drivers/staging/omapdrm/omap_crtc.c +++ b/drivers/staging/omapdrm/omap_crtc.c @@ -114,40 +114,21 @@ static void omap_crtc_load_lut(struct drm_crtc *crtc) static void vblank_cb(void *arg) { - static uint32_t sequence = 0; struct drm_crtc *crtc = arg; struct drm_device *dev = crtc->dev; struct omap_crtc *omap_crtc = to_omap_crtc(crtc); - struct drm_pending_vblank_event *event = omap_crtc->event; unsigned long flags; - struct timeval now; WARN_ON(!event); + spin_lock_irqsave(&dev->event_lock, flags); + + /* wakeup userspace */ + if (omap_crtc->event) + drm_send_vblank_event(dev, -1, omap_crtc->event); omap_crtc->event = NULL; - /* 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, - &event->base.file_priv->event_list); - wake_up_interruptible(&event->base.file_priv->event_wait); - spin_unlock_irqrestore(&dev->event_lock, flags); - } + spin_unlock_irqrestore(&dev->event_lock, flags); } static void page_flip_cb(void *arg)