From patchwork Wed Jul 22 11:04:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 11678277 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 667A613A4 for ; Wed, 22 Jul 2020 11:04:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4241720771 for ; Wed, 22 Jul 2020 11:04:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="blnhOXIR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4241720771 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E3D16E044; Wed, 22 Jul 2020 11:04:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 130736E044 for ; Wed, 22 Jul 2020 11:04:23 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id y3so1480463wrl.4 for ; Wed, 22 Jul 2020 04:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=OCy4M+IerAUwrGq+R10RYFBywYGUc8/udZhkNLn8gcA=; b=blnhOXIRlgBIHslJnR+DyX3qRw0egROpKwj7Y0Zkk0MMdUtpreXtgx75Kq1wPrfpcw YT0xqBP0X9bvfkLrjDAjTmnTxzFZrZQIvAqUg6rrrRMpE1+2Am8fg/BMXJTPLpUCrRHG WG4KDPcO+AnnCn+WJph8oQSDcEQOtFVBnYkClbRvOg2bqXfvK2yeOn1d/J2s59wzpd0b VTw1CPE1C6poESLQsUVR+9mx8lbuqnKWymfrOoz608Ea4C1gFhgHQ1OA0EBcrOP2hpnE 2Z07LwLiO83BYhupbyWqS0g8hcUHHqXlNFYa0FOnBXmju5sMmeNIWSPap5YxzMnH1UeX n0Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=OCy4M+IerAUwrGq+R10RYFBywYGUc8/udZhkNLn8gcA=; b=edtDRS2HFZU9tIlcVDp7M0+08/YR6+oIxdTIySbJQWo+CIaZ+v0H1JjykWgBuXkFi0 i38vwIZg5qFZnCKauvFPTukkZv3u8182M5FVQeXLBHoTILXq0NuQ82tGqJDQKkz/ae4J aqC+n3hGw1vw0czexA0wY1GZhmem9pS5f4DzRVfGPlcl7ro7AJFOMed5bTevJoWwxsEu 237qP9++sO9/nKb+Pq839Z3lItcPTsHuR/rP7U/CUjgqdWbPHJXYGPA0yCIcBGI5Vywn J1Qq36KPmn2hvU37cPsLXpVK4xd8bqynl4zN2BwP0brjCZXQ6EUoriB6EXLYfEGn7WBa gLjg== X-Gm-Message-State: AOAM533CeYnRRZnXiygEBQqtfhfM6wWT6aIegCCla+qeUFYugiFaV6Hv byXjQE6tLn/QNynhRodUBa8= X-Google-Smtp-Source: ABdhPJyen9XQxbMOmxYyIRo9xkcOiFhcP/BsUcVILGQr7xM0UXW3SkKzFeItTtT4WGFXCvo6Y3Wceg== X-Received: by 2002:adf:ea06:: with SMTP id q6mr29366083wrm.69.1595415861662; Wed, 22 Jul 2020 04:04:21 -0700 (PDT) Received: from smtp.gmail.com (a95-92-181-29.cpe.netcabo.pt. [95.92.181.29]) by smtp.gmail.com with ESMTPSA id t2sm6735027wma.43.2020.07.22.04.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 04:04:21 -0700 (PDT) Date: Wed, 22 Jul 2020 08:04:11 -0300 From: Melissa Wen To: Rodrigo Siqueira , Haneen Mohammed , Daniel Vetter , David Airlie , Rodrigo Siqueira Subject: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush Message-ID: <20200722110411.ebkv6knvc6mzw5uf@smtp.gmail.com> MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel-usp@googlegroups.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds a missing drm_crtc_vblank_put op to the pair drm_crtc_vblank_get/put (inc/decrement counter to guarantee vblanks). It clears the execution of the following kms_cursor_crc subtests: 1. pipe-A-cursor-[size,alpha-opaque, NxN-(on-screen, off-screen, sliding, random, fast-moving])] - successful when running individually. 2. pipe-A-cursor-dpms passes again 3. pipe-A-cursor-suspend also passes The issue was initially tracked in the sequential execution of IGT kms_cursor_crc subtest: when running the test sequence or one of its subtests twice, the odd execs complete and the pairs get stuck in an endless wait. In the IGT code, calling a wait_for_vblank before the start of CRC capture prevented the busy-wait. But the problem persisted in the pipe-A-cursor-dpms and -suspend subtests. Checking the history, the pipe-A-cursor-dpms subtest was successful when, in vkms_atomic_commit_tail, instead of using the flip_done op, it used wait_for_vblanks. Another way to prevent blocking was wait_one_vblank when enabling crtc. However, in both cases, pipe-A-cursor-suspend persisted blocking in the 2nd start of CRC capture, which may indicate that something got stuck in the step of CRC setup. Indeed, wait_one_vblank in the crc setup was able to sync things and free all kms_cursor_crc subtests. Tracing and comparing a clean run with a blocked one: - in a clean one, vkms_crtc_atomic_flush enables vblanks; - when blocked, only in next op, vkms_crtc_atomic_enable, the vblanks started. Moreover, a series of vkms_vblank_simulate flow out until disabling vblanks. Also watching the steps of vkms_crtc_atomic_flush, when the very first drm_crtc_vblank_get returned an error, the subtest crashed. On the other hand, when vblank_get succeeded, the subtest completed. Finally, checking the flush steps: it increases counter to hold a vblank reference (get), but there isn't a op to decreased it and release vblanks (put). Cc: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Signed-off-by: Melissa Wen --- drivers/gpu/drm/vkms/vkms_crtc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index ac85e17428f8..a99d6b4a92dd 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -246,6 +246,7 @@ static void vkms_crtc_atomic_flush(struct drm_crtc *crtc, spin_unlock(&crtc->dev->event_lock); + drm_crtc_vblank_put(crtc); crtc->state->event = NULL; }