From patchwork Mon Oct 8 19:50:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 1566881 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 1A554DFF71 for ; Mon, 8 Oct 2012 19:57:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 044ECA08A9 for ; Mon, 8 Oct 2012 12:57:33 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 32B57A087F for ; Mon, 8 Oct 2012 12:51:26 -0700 (PDT) Received: by mail-ob0-f177.google.com with SMTP id wd20so4102825obb.36 for ; Mon, 08 Oct 2012 12:51:26 -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=ty9RBv7Zn3bOfBxNd29m/8Hp1sljq7D0iZhSRHzFvKM=; b=U726c9feY5J/ctM4coShSBUuy2RTUxNkXJQQUaZNrIFKRbJB/KSSSvwRv/tzAyJQHj PuCQW9/AAtMqRigGxHkOXvdF40qSok40ktLot9qymJAXwPt99InMQpRiOvjgZzEgn17J 6Y73aNUPVA/oZ37EpJBaCg1akt5DC5NLM3BiJXV2qwzJrNAVY05OUlg9jbc9amSi/Io0 AAFpOFAhTx4dKeuG/5qNom1IzUZAr1N7ayCFKNCQsJvjfZsx6pEgGnFLzyZ8UFi61nNc 5EYx5QYQHAeM4qTOtWoRy964qSIE9sCPCkJhr5AhXiFnoBPqInlqgGoO2OT6xL69P/nu 8SZg== Received: by 10.182.147.8 with SMTP id tg8mr1037810obb.21.1349725886648; Mon, 08 Oct 2012 12:51:26 -0700 (PDT) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id ea6sm18002405obc.9.2012.10.08.12.51.25 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 12:51:26 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH 07/11] drm/shmob: use drm_send_vblank_event() helper Date: Mon, 8 Oct 2012 14:50:45 -0500 Message-Id: <1349725849-22433-8-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> Cc: patches@linaro.org, daniel.vetter@ffwll.ch, laurent.pinchart@ideasonboard.com, gregkh@linuxfoundation.org, Rob Clark , bskeggs@redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Rob Clark Signed-off-by: Rob Clark --- drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c index 0e7a930..3ecb702 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c @@ -451,27 +451,16 @@ void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) { struct drm_pending_vblank_event *event; struct drm_device *dev = scrtc->crtc.dev; - struct timeval vblanktime; unsigned long flags; spin_lock_irqsave(&dev->event_lock, flags); event = scrtc->event; scrtc->event = NULL; + if (event) { + drm_send_vblank_event(dev, 0, event); + drm_vblank_put(dev, 0); + } spin_unlock_irqrestore(&dev->event_lock, flags); - - if (event == NULL) - return; - - event->event.sequence = drm_vblank_count_and_time(dev, 0, &vblanktime); - event->event.tv_sec = vblanktime.tv_sec; - event->event.tv_usec = vblanktime.tv_usec; - - spin_lock_irqsave(&dev->event_lock, flags); - 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); - - drm_vblank_put(dev, 0); } static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc,