From patchwork Fri May 6 17:26:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9034941 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F1D489F1D3 for ; Fri, 6 May 2016 17:26:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26DC22039D for ; Fri, 6 May 2016 17:26:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6BAD9202BE for ; Fri, 6 May 2016 17:26:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 861726EB1C; Fri, 6 May 2016 17:26:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id C15586EB1C for ; Fri, 6 May 2016 17:26:41 +0000 (UTC) Received: by mail-wm0-x22b.google.com with SMTP id g17so88530585wme.1 for ; Fri, 06 May 2016 10:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FfZxLDCisNWPzuPiP31s5+mUO+hkk4txJ5tmFQ5TkaU=; b=vJEGC1X/Ap9KpbtdRKPUA3IYKuc7H3MbETGzkC7uVfb+yf7lptbkhgv06I/Uj/FTB2 KLnx3EGMMqzET6h8rMUnIccMRsd9OguPgyY5/+kgFsxgNuyexxHHP9Z0cykOJvwNBTv/ XumdvPxsJS5Xv32ap99UBkV+Nk0PdiypXq8vcAzM77+LSE0EreU33seuy2cjCBO5ElhE 5qP9FTjAtUNDGKG63LSd0GskTqiLO0lHdrpZhc0MHI3CM8uIISFTAGIQRZfneCyIVbtf GfX+h2Jqu1lSTBzFeNH1pMNS8DMnatLLx/Noh1B7K64JVm1aSOQ56Pnt/I1CluGx1Y0R 40LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FfZxLDCisNWPzuPiP31s5+mUO+hkk4txJ5tmFQ5TkaU=; b=f4ypzuJoyP0LLvhO+y3G5hWVtIn6NGw1rSsw73sRf+DjNQUu+9vbTjZFpzpMt/YdvO YXFJehKq3/CBodouiueFmir0AdRbzh++9ECTiAIw0bMedov12RwP7/iREPM8AzwBQ97e HR7NOJSnXyXpTVqinYvnXlUwz7opLroRqLWlY5L11YDmzrMISRXa/1Pb3ViD1Xemf2ni I+Om9uGtKMMiELmGv3Fer1/cDDMzq0Q3F6B5mPIsF/jAbVQXcn+kAFCw6NrORDFQcTeQ U3qvsoTxLQXraWFFdVdJjdv1Q8+lSj6YU0yvuUs3EDFcU0atUw2v1xiaBQnHooeutPtv o+BA== X-Gm-Message-State: AOPr4FUF6Xv/6Vvwi+OR2s2YtzP7f2c3IiKmL+pP0UERffpbJp0/6pEeh36wRl9CeCdQSQ== X-Received: by 10.28.7.197 with SMTP id 188mr11053355wmh.101.1462555600403; Fri, 06 May 2016 10:26:40 -0700 (PDT) Received: from twisty.cin.medizin.uni-tuebingen.de (cin-11.medizin.uni-tuebingen.de. [134.2.118.242]) by smtp.gmail.com with ESMTPSA id g197sm9428955wme.15.2016.05.06.10.26.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 10:26:39 -0700 (PDT) From: Mario Kleiner To: eric@anholt.net Subject: [PATCH 2/2] drm/vc4: Fix drm_vblank_put/get imbalance in page flip path. Date: Fri, 6 May 2016 19:26:06 +0200 Message-Id: <1462555566-27612-3-git-send-email-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1462555566-27612-1-git-send-email-mario.kleiner.de@gmail.com> References: <1462555566-27612-1-git-send-email-mario.kleiner.de@gmail.com> Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The async page flip path was missing drm_crtc_vblank_get/put completely. The sync flip path was missing a vblank put, so async flips only reported proper pageflip completion events by chance, and vblank irq's never turned off after a first vsync'ed page flip until system reboot. Tested against Raspian kernel 4.4.8 tree on RPi 2B. Signed-off-by: Mario Kleiner Cc: Eric Anholt --- drivers/gpu/drm/vc4/vc4_crtc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 355ee4b..c3854e2 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -456,6 +456,7 @@ static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) if (vc4_crtc->event) { drm_crtc_send_vblank_event(crtc, vc4_crtc->event); vc4_crtc->event = NULL; + drm_crtc_vblank_put(crtc); } spin_unlock_irqrestore(&dev->event_lock, flags); } @@ -506,6 +507,7 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) spin_unlock_irqrestore(&dev->event_lock, flags); } + drm_crtc_vblank_put(crtc); drm_framebuffer_unreference(flip_state->fb); kfree(flip_state); @@ -548,6 +550,8 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, return ret; } + WARN_ON(drm_crtc_vblank_get(crtc) != 0); + /* Immediately update the plane's legacy fb pointer, so that later * modeset prep sees the state that will be present when the semaphore * is released.