From patchwork Mon Oct 8 19:50:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 1566921 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 165E4DFF71 for ; Mon, 8 Oct 2012 20:00:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F418AA08AE for ; Mon, 8 Oct 2012 13:00:58 -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 DFE9C9F373 for ; Mon, 8 Oct 2012 12:51:34 -0700 (PDT) Received: by mail-oa0-f49.google.com with SMTP id l10so544651oag.36 for ; Mon, 08 Oct 2012 12:51:34 -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=whN/FGlPfAnRaPjZusO5LlXxipStNo+WSTvnRG3+eyc=; b=sCI/H2kvUJ+GKPGLnuGyOXSfSYcy0YtmWM98qQQ8wQvCp/N2DeCJUoafCBD75bp9Dv Ndq4qP5fb9UG4CJ6OOOgEythZ5Eq3sHl03Z1rTA3DJIpHNV0wlDgYWe99SzvlMLyj/3O KgKTjIDC6OnZ/zIbgudR/Ycm8g9EmW96VfjPOLofaIrRx1aLITHZ/SihvvjekI70UeXT hEpgVVP7MJgc77WYqyJBJ/GvMDXOY5ol1sWwYT5Z3JmZVaz4nxja4BdQqfyBakmbn3av oHuKeWuImjf5IFNEKwDI2m0s5senItwScofrLz0Cfg4YPWvsG93wvj6ALfN+tCqveWcs PjyA== Received: by 10.60.170.200 with SMTP id ao8mr13989016oec.104.1349725894711; Mon, 08 Oct 2012 12:51:34 -0700 (PDT) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id jd10sm17997777obb.13.2012.10.08.12.51.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 12:51:34 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH 11/11] drm/omap: page-flip fixes Date: Mon, 8 Oct 2012 14:50:49 -0500 Message-Id: <1349725849-22433-12-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 Userspace might not request a vblank event. So it is not an error for 'event' to be NULL, and we shouldn't use it to determine if there is a pending flip already. Signed-off-by: Rob Clark Reviewed-by: Imre Deak --- drivers/staging/omapdrm/omap_crtc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c index 74e019a..317b854 100644 --- a/drivers/staging/omapdrm/omap_crtc.c +++ b/drivers/staging/omapdrm/omap_crtc.c @@ -119,7 +119,6 @@ static void vblank_cb(void *arg) struct omap_crtc *omap_crtc = to_omap_crtc(crtc); unsigned long flags; - WARN_ON(!event); spin_lock_irqsave(&dev->event_lock, flags); /* wakeup userspace */ @@ -127,6 +126,7 @@ static void vblank_cb(void *arg) drm_send_vblank_event(dev, -1, omap_crtc->event); omap_crtc->event = NULL; + omap_crtc->old_fb = NULL; spin_unlock_irqrestore(&dev->event_lock, flags); } @@ -138,8 +138,6 @@ static void page_flip_cb(void *arg) struct drm_framebuffer *old_fb = omap_crtc->old_fb; struct drm_gem_object *bo; - omap_crtc->old_fb = NULL; - omap_crtc_mode_set_base(crtc, crtc->x, crtc->y, old_fb); /* really we'd like to setup the callback atomically w/ setting the @@ -162,7 +160,7 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc, DBG("%d -> %d", crtc->fb ? crtc->fb->base.id : -1, fb->base.id); - if (omap_crtc->event) { + if (omap_crtc->old_fb) { dev_err(dev->dev, "already a pending flip\n"); return -EINVAL; }