From patchwork Thu Jan 21 15:29:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12036701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50A9CC433E0 for ; Thu, 21 Jan 2021 15:30:17 +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 EB6E023A1C for ; Thu, 21 Jan 2021 15:30:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB6E023A1C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 998496E8FC; Thu, 21 Jan 2021 15:30:09 +0000 (UTC) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id E67526E8FC for ; Thu, 21 Jan 2021 15:30:08 +0000 (UTC) Received: by mail-wr1-x432.google.com with SMTP id g10so2162288wrx.1 for ; Thu, 21 Jan 2021 07:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cO1IkKPUOVwRn1crpsdxPu7FkoF7p+ucW3GbJhM3e14=; b=jhC25ghF/XaqC35+yLTxVb7Wu3JLRJXw2J2hDlMlBegM1HgvqArOVwueF+WlNe1LK0 iAxoO75LoZrCTVQkpHH8oySG5WCiFgXObeuTlNMlP86RWNc969Ycv/BYdMOvA8ZurmTu IPauh1ssYJZERfONi1YMonwWMecl3j/Y7Jjz8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cO1IkKPUOVwRn1crpsdxPu7FkoF7p+ucW3GbJhM3e14=; b=QYTauLWHFk5StRPEgQHgayO1tOkk+sk72nk2rwgc0e/u2+NcRX8W+qk65CeJqsCUQZ 57QgKE/UI7LZXgwTO2ahePLC6C7OmxZ1YovknRcEp/YAWOAxiIA7mZM00A3zJuAPyVjX XkcXaMao0t7WYlXbL8QmF7BTJMWvuieMAtrqGOxTRnZ2YjHBBOr8QHNMh4STx6odD6P5 unmW1CVSr0eM30WJ39JFayUxPGsdpQNoS4SEcn7ScAzuv1QHWHd+4PZu/eXpWIB8tTBp EWxFrru5Y1CeBZXdTym+f8mlZ+HBNEJa35TyD3+UMoLCbvuNZjWEtyYyTHA7kCuVPgR9 pRyg== X-Gm-Message-State: AOAM532uupdSIx98M/7ASI/3+c0bnz4iQkNM5lnqz7GCMQRnmN+58VrC 3eIWo4kZ0IrTpcdujau66aUWnQ== X-Google-Smtp-Source: ABdhPJzW179r+95gTC9AApAezahGncz7nZxmZZU6SylexVR2TnthZyEScn1yu5DpB9svGDcS52Nyxg== X-Received: by 2002:a5d:49c1:: with SMTP id t1mr33276wrs.56.1611243007580; Thu, 21 Jan 2021 07:30:07 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id f14sm8269866wre.69.2021.01.21.07.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 07:30:06 -0800 (PST) From: Daniel Vetter To: DRI Development Date: Thu, 21 Jan 2021 16:29:50 +0100 Message-Id: <20210121152959.1725404-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210121152959.1725404-1-daniel.vetter@ffwll.ch> References: <20210121152959.1725404-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 02/11] drm/vkms: Annotate vblank timer X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-mm-sig@lists.linaro.org, Rodrigo Siqueira , Haneen Mohammed , linux-rdma@vger.kernel.org, Daniel Vetter , intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Chris Wilson , Melissa Wen , Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= , linux-media@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This is needed to signal the fences from page flips, annotate it accordingly. We need to annotate entire timer callback since if we get stuck anywhere in there, then the timer stops, and hence fences stop. Just annotating the top part that does the vblank handling isn't enough. Tested-by: Melissa Wen Reviewed-by: Rodrigo Siqueira Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Cc: linux-rdma@vger.kernel.org Cc: amd-gfx@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Christian König Signed-off-by: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Cc: Daniel Vetter --- drivers/gpu/drm/vkms/vkms_crtc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 0443b7deeaef..6164349cdf11 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ +#include + #include #include #include @@ -14,7 +16,9 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) struct drm_crtc *crtc = &output->crtc; struct vkms_crtc_state *state; u64 ret_overrun; - bool ret; + bool ret, fence_cookie; + + fence_cookie = dma_fence_begin_signalling(); ret_overrun = hrtimer_forward_now(&output->vblank_hrtimer, output->period_ns); @@ -49,6 +53,8 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) DRM_DEBUG_DRIVER("Composer worker already queued\n"); } + dma_fence_end_signalling(fence_cookie); + return HRTIMER_RESTART; }