From patchwork Mon Apr 29 22:08:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chia-I Wu X-Patchwork-Id: 10922559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60D681390 for ; Mon, 29 Apr 2019 22:08:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 503C3289EF for ; Mon, 29 Apr 2019 22:08:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 451D7289F3; Mon, 29 Apr 2019 22:08:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E0AF289EF for ; Mon, 29 Apr 2019 22:08:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C4768934F; Mon, 29 Apr 2019 22:08:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id 81278892E4 for ; Mon, 29 Apr 2019 22:08:29 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id b3so5727848plr.7 for ; Mon, 29 Apr 2019 15:08:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DSXLhD7wHCaSgLKFWGmhSkyMj1YNvbI1NjkgvBf+Kws=; b=WT6H5IJqK7HrDEeb83NjHhArmxqDjJVoALSubzRqLTqyLzPlWNzN5+X3i73Kfa6zBQ pVG3uW7uNr772j1WrOroztVKWTEJ4v0pdtnVJ8PL19dc5OmelOUTxidytN25b2MpX0vj 6HWRJfYse3mfzqqXte0veoKwrcodKUiAqgyvZ9xNPxBkkHgh7MMXORYIZ1BVsr0az4yX G4/9SkmDiB11M75QRcvlBP6rrWyAqXILV9OuN//n7St6sKic/PAHc57LmYWwmFiun4RR XxxXAFQnCFKTmM/nLmsOKk+FyI7+Uza6NR8O7tinURKHwtxEUhRCBDm//Ekzd9NHU0+v n9dQ== X-Gm-Message-State: APjAAAWmYSWPuTgc/3VKTnv+5CgUS8W6kXKatLAAFAcbAOeeNqCQ0n9a /fPgOFMH37GpHAY6WgijPApfu5gp X-Google-Smtp-Source: APXvYqyy0lG7vVgK77wDJ8wX1L9TblWrlFg5ViAqpVt78Ksd3Y8r5fRZraYxR8/CUn4f5iJsq4AXwQ== X-Received: by 2002:a17:902:2cc1:: with SMTP id n59mr1834391plb.22.1556575708781; Mon, 29 Apr 2019 15:08:28 -0700 (PDT) Received: from olv0.mtv.corp.google.com ([2620:15c:202:201:9649:82d6:f889:b307]) by smtp.gmail.com with ESMTPSA id g3sm14828635pfm.167.2019.04.29.15.08.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 15:08:28 -0700 (PDT) From: Chia-I Wu To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/virtio: trace drm_fence_emit Date: Mon, 29 Apr 2019 15:08:24 -0700 Message-Id: <20190429220825.156644-2-olvaffe@gmail.com> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog In-Reply-To: <20190429220825.156644-1-olvaffe@gmail.com> References: <20190429220825.156644-1-olvaffe@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=DSXLhD7wHCaSgLKFWGmhSkyMj1YNvbI1NjkgvBf+Kws=; b=KjKueBg4FXrmLVN1N9isYalx6Up4cfpJx2Hgj6YyqLlwSk/w7J3DmFW64HSk88ueuS LRPJl1E3BP+D0MLJV0m6eCzVEp1Y1j5lUNCCXKy2Z4XzgFWLfXUe0Vcg6RElKyrW/AxU Y9o+pyc5u8/c3bZoCgabMVWvgiikDnvTTPe79QPlr+6Hfnf5kAVgcjHa4Z8LZ0v2JYSo LjS+Wo1/pepADGo9jaVTBd7WWbGJujO5jaysCkcL2XkwAJAmfQGjcLQ4rQiaa5Li9nce Tuv4ts/nJniA2jKquNTnt8DqKNKUGpkYikCYl/wgRbcGbITR5ftpbeYN+M+HdFifD/Aq Jb4g== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For most drivers, drm_fence_init is followed by drm_fence_emit immediately. But for our driver, they are done separately. We also don't know the fence seqno until drm_fence_emit. Signed-off-by: Chia-I Wu --- drivers/gpu/drm/virtio/virtgpu_fence.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index 72b4f7561432..e22918ca621b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fence.c +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c @@ -24,6 +24,7 @@ */ #include +#include #include "virtgpu_drv.h" static const char *virtio_get_driver_name(struct dma_fence *f) @@ -97,6 +98,8 @@ int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev, list_add_tail(&fence->node, &drv->fences); spin_unlock_irqrestore(&drv->lock, irq_flags); + trace_dma_fence_emit(&fence->f); + cmd_hdr->flags |= cpu_to_le32(VIRTIO_GPU_FLAG_FENCE); cmd_hdr->fence_id = cpu_to_le64(fence->f.seqno); return 0;