Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp419327ybh; Wed, 22 Jul 2020 04:07:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy703rjWK5QgKqxdxNxcy2hlf49osUGk4e+4fX3t+RT52YC4FJgcjlGfx89jRSUfpQgV2e8 X-Received: by 2002:a17:906:d057:: with SMTP id bo23mr29435312ejb.210.1595416065886; Wed, 22 Jul 2020 04:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595416065; cv=none; d=google.com; s=arc-20160816; b=DaanirBiJ6pXKi6l36v/cuKV2dI4tubCSL9KECa9NCKxPsDoSilZwYDd8p374nHgKj uEASpETowkEgZLrDXjRZo1oCKVFuz+KA6R6shL8DmiiGzu8Z2AXsWbfGW+078LvVSXaw 2UDqNJpcre8R0wGDy61pxIqv8wPndhd1NICbqdjI2oWB9bceuWD0Sz2lHYxf50m3VTSG 9E/l4TlEddXpkLGL6NzkfQzCcL9oHtJUndE1lLV6eaM2WitD4V0/I8B/BYeKDssXIzDD IufE4s+PnPIy/22p3Ox3TUTRouMkgQmoshrgdpSLU49mJCGuUgrc70VVmvnSxQ+6uJMg sNjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=OCy4M+IerAUwrGq+R10RYFBywYGUc8/udZhkNLn8gcA=; b=Ob6CUOI2FJ3BWHsqEczkI7sa7MxVW7uZ2GGXIBqrWj0MgrwlUGcWrGoPwICwxjfRyD 92uMCLKWQns752ywBCGDa05uVnONS1MxqyFXwKOWysKJBWtnyGSTZGfdawrhYA6iBVUC R4un1L5ckfz80kFgVhtfLvR7wivKQCCyzQtQWZN7u5wllMeQOXeTrpu/oNGJRBDsOLS4 5MbEyoNQFVvfSJEooeOmJYjUkxT2wkqAg7usQbnmVRu3uSgAxyUtT1pmSJab7czuWd4X E2G3DalzX9xVCaHk+/LEag+L1sOeAHwSNDVcZTn9OFukyu4zp3od4U2CCvS6D1HLCdBY kKIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=blnhOXIR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h25si13569878ejx.479.2020.07.22.04.07.22; Wed, 22 Jul 2020 04:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=blnhOXIR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732251AbgGVLEZ (ORCPT + 99 others); Wed, 22 Jul 2020 07:04:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729064AbgGVLEX (ORCPT ); Wed, 22 Jul 2020 07:04:23 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0664DC0619DC for ; Wed, 22 Jul 2020 04:04:23 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id a15so1460740wrh.10 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=Mc9dCG7d+wS0lzUm7bVrMVmSvoordyyrxIn+slHaG6921MIcSvpgYcEbaoHpKK3DEO wdGWducVgsFi3a3QsrWPBrs16bkRtQdHyIhA8r7MVKGCuCcrv6YGKyy5iHHF4ymcBLrl MdtGzwz7zjTOKkDPnMHdBj5DwIsvctTk6brwszWBkKyCRoSSnyfm+umPpRv25jCyvdFv 0zkz5OGqhaP30I5n4P+VaeIqPmN/6gdZCx7n2mKxudoKkibT/6O2ioVeE0Nnjtwc5DOR 3bIhxJE/3X7jwnf+BdjIaFFJCU6cDfcmpBomBf11c8Jz/2CxkfkWWp68KuAXpKvpsTPO mV/g== X-Gm-Message-State: AOAM530FgtPxffUNg0y9gVUWOKkjPYjOuxuSnaocyCrG7Np8s7xGolEe HpgUV2Lh/z7lPx2SQAMDrcTFTS1ybIQ= 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com, twoerner@gmail.com 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-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.27.0