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: 12054 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 6B3D723FB3 for ; Mon, 8 Oct 2012 19:51:36 +0000 (UTC) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0C054A18BDA for ; Mon, 8 Oct 2012 19:51:35 +0000 (UTC) Received: by mail-pa0-f52.google.com with SMTP id hz10so4789627pad.11 for ; Mon, 08 Oct 2012 12:51:35 -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=whN/FGlPfAnRaPjZusO5LlXxipStNo+WSTvnRG3+eyc=; b=Tm+eB8oHC226XL0uJfj8tWN8aTUrzinvIl+wm5FCHryTZVSCmz2aZC+yyj1rA58fSk SuWjntgUY0fzSLHlkDn5BL7IZFTtxa/VQaDuWZ7zRJvU3gTtbPLNFTABj51QEHDKXnHT aoY6Raqppxe8ENlBTbjSvR9R7FMa8UIn9XF6PKcZgXYt4WdSy1quAzgcJhf+KUfs8IJr 2MA3cyc/sa9LC9MDC2zf3vIZ3AC1KaSkfUAskFF9r/KKuJkJ5sTJy5mUbLInN2RzkVF4 qCYfmNgJJ1tt/rtfHDRfAMD2gCFIWaQK0+Hefsk1c1OMctOc0pRK1Xw8OQWFuySPKnCX YDCA== Received: by 10.66.79.36 with SMTP id g4mr45685311pax.67.1349725895732; Mon, 08 Oct 2012 12:51:35 -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 z9csp314553pbi; Mon, 8 Oct 2012 12:51:35 -0700 (PDT) Received: by 10.60.28.167 with SMTP id c7mr9979237oeh.44.1349725894971; Mon, 08 Oct 2012 12:51:34 -0700 (PDT) Received: from mail-oa0-f50.google.com (mail-oa0-f50.google.com [209.85.219.50]) by mx.google.com with ESMTPS id ym2si20201401obb.141.2012.10.08.12.51.34 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 12:51:34 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.219.50 as permitted sender) client-ip=209.85.219.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.219.50 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-oa0-f50.google.com with SMTP id n16so611275oag.37 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) 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 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> X-Gm-Message-State: ALoCoQnLIXyI0MxwXvJUrrP8HYpr5QZ8qm55AfWwUyVln+BQKxhdfv0WoikRXRC93cH0ppKaLulD 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; }