From patchwork Sun Mar 25 10:59:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 10306583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6487C60385 for ; Sun, 25 Mar 2018 11:00:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5593C2855C for ; Sun, 25 Mar 2018 11:00:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A53529308; Sun, 25 Mar 2018 11:00:19 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 DC8522855C for ; Sun, 25 Mar 2018 11:00:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 78FE96E423; Sun, 25 Mar 2018 11:00:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 18A216E417; Sun, 25 Mar 2018 11:00:07 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id f125so10484202wme.4; Sun, 25 Mar 2018 04:00:07 -0700 (PDT) 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=OFojixgaaxFKwB6P2kBxK69ZuHZr4rYgtmUC66EmBpQ=; b=f7/cGbgADICko2FSWAHuUEJ+0SfDUvcrJ79vYdllYlhxJSJbjYn+3VVEZxYV+66LMj at8X4zLdd1122WxzSi5heDAxEWXdkpkVQSUQ295e5vN6XuoNjiaNFQbsz1b9THFtzHqr gMdv9l2HgbeDJ/gaIEkrP1k7ibT3TAuCSrwSB0Kon/pMTHp3FR6Z7VjUsunIftNplNXU fjfpqB5w3dOeY8vNViDnkV/7stD07icHNGURIt7Y8ffiG4gDENXhOVABuXv9Uu+1mYUh hDN6XID9IGdwcReG+2q6yzwn1Y7Phw+Er1oq9jW/TQz7mKnf6jvylMT8aWc1ihL3AIye Z0PA== 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=OFojixgaaxFKwB6P2kBxK69ZuHZr4rYgtmUC66EmBpQ=; b=G1OCk5vqJ2UubgVhEiuCOGZXkqgxNrEn1G+gln89dhTDdxQGa8FfOzkM63Jeh02QNi YwqpWtPUHqLb65WFXlz4olbd8TTDsEY0Di7aqFWsNzAQvgDdaFDNWRmcqWZ/gCT9Rvxe U37TG9ZbuFmLMHYp1bB9NcpG2iyingUXyijQPH8ny3FF7Uy+JmZJDqerL6v75Ovlo0vs /c74VNTwsQPIZG1Uf0CzdCP9fAh6xbHMadA129MxmyADgBfZaNmM1dn9ZXhZN7WiYUAu mjdU3ZR7LilxToLO6rTQMX76mkt6vP4NU5TR1EhcMN//PFEz4iKA+Rutor1InsFFKQOr F/Sw== X-Gm-Message-State: AElRT7HTKS5a3J0G6s5dCoi2rYGLP/MWIS1h8yykk0aXlAiuUNB/BJFv tFIYH8EeT8vvV7Q20Y4UZY8= X-Google-Smtp-Source: AG47ELt2/RPFP+KFT1I2uo/XpV9anVM9FW200RoE0eLPf3iA9c5h8NgBgXLb3J8Zcdswr97Y6dgh4g== X-Received: by 10.28.197.205 with SMTP id v196mr13709978wmf.39.1521975605781; Sun, 25 Mar 2018 04:00:05 -0700 (PDT) Received: from baker.fritz.box ([2a02:908:1257:4460:80f2:8bcd:4355:2edc]) by smtp.gmail.com with ESMTPSA id z3sm20492230wme.3.2018.03.25.04.00.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 04:00:05 -0700 (PDT) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] drm/amdgpu: print DMA-buf status in debugfs Date: Sun, 25 Mar 2018 12:59:57 +0200 Message-Id: <20180325110000.2238-5-christian.koenig@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180325110000.2238-1-christian.koenig@amd.com> References: <20180325110000.2238-1-christian.koenig@amd.com> MIME-Version: 1.0 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 Just note if a BO was imported/exported. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 46b9ea4e6103..7c1f761bb1a5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -777,6 +777,8 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data) struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj); struct seq_file *m = data; + struct dma_buf_attachment *attachment; + struct dma_buf *dma_buf; unsigned domain; const char *placement; unsigned pin_count; @@ -805,6 +807,15 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data) pin_count = READ_ONCE(bo->pin_count); if (pin_count) seq_printf(m, " pin count %d", pin_count); + + dma_buf = READ_ONCE(bo->gem_base.dma_buf); + attachment = READ_ONCE(bo->gem_base.import_attach); + + if (attachment) + seq_printf(m, " imported from %p", dma_buf); + else if (dma_buf) + seq_printf(m, " exported as %p", dma_buf); + seq_printf(m, "\n"); return 0;