From patchwork Mon Oct 8 19:50:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 1566851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id A54F340135 for ; Mon, 8 Oct 2012 19:54:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 341E6A088D for ; Mon, 8 Oct 2012 12:54:48 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oa0-f49.google.com (mail-oa0-f49.google.com [209.85.219.49]) by gabe.freedesktop.org (Postfix) with ESMTP id C0F629F373 for ; Mon, 8 Oct 2012 12:51:20 -0700 (PDT) Received: by mail-oa0-f49.google.com with SMTP id l10so544651oag.36 for ; Mon, 08 Oct 2012 12:51:20 -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=amtdnlVb7vxyEdXU1pBWrclE0rztt+CQkuro5ZCXHfs=; b=CtjrT/oM0dAPyWsDrJg9DguI8PYXsT5/J1b4SCMna/t2JJ2fRmNj4E0qntV1l98r8E /gz4dwvRpPaob5X0LXVpuezuvVhkr6VFdf+hFcpV8qb0eBMrQDrTNQu9shBgwYklhF6E ZAt2losnLQeey70itfYII4nSJFdHMqzraojOj56pvLy5N2BZW7S6ea+w9ctEp5AvlFzX iuXUUEO8NCX3iomT2Im3U5trOPcBYuM+ymXbERToafEiHvptzLwFcSdaOMeY3sZf6NFR ohG3BUsC9lt1ZEQKYjS9182LYbPaDke2FqcXa7iiEDB/J1JqQeMlvrii1MMmy7JBtud+ Fr/Q== Received: by 10.60.171.199 with SMTP id aw7mr3746445oec.54.1349725880536; Mon, 08 Oct 2012 12:51:20 -0700 (PDT) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id b5sm17992428obd.18.2012.10.08.12.51.19 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 12:51:20 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH 04/11] drm/radeon: use drm_send_vblank_event() helper Date: Mon, 8 Oct 2012 14:50:42 -0500 Message-Id: <1349725849-22433-5-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/radeon/radeon_display.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 7ddef8f..8dad9c2 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -271,8 +271,6 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) { struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; struct radeon_unpin_work *work; - struct drm_pending_vblank_event *e; - struct timeval now; unsigned long flags; u32 update_pending; int vpos, hpos; @@ -328,14 +326,9 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) radeon_crtc->unpin_work = NULL; /* wakeup userspace */ - if (work->event) { - e = work->event; - e->event.sequence = drm_vblank_count_and_time(rdev->ddev, crtc_id, &now); - e->event.tv_sec = now.tv_sec; - e->event.tv_usec = now.tv_usec; - list_add_tail(&e->base.link, &e->base.file_priv->event_list); - wake_up_interruptible(&e->base.file_priv->event_wait); - } + if (work->event) + drm_send_vblank_event(rdev->ddev, crtc_id, work->event); + spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id);