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: 10306579 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 449F96063D for ; Sun, 25 Mar 2018 11:00:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3690B2855C for ; Sun, 25 Mar 2018 11:00:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B6A829042; Sun, 25 Mar 2018 11:00:15 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A520329308 for ; Sun, 25 Mar 2018 11:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752914AbeCYLAM (ORCPT ); Sun, 25 Mar 2018 07:00:12 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36710 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbeCYLAH (ORCPT ); Sun, 25 Mar 2018 07:00:07 -0400 Received: by mail-wm0-f65.google.com with SMTP id x82so10500788wmg.1; Sun, 25 Mar 2018 04:00:06 -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=Uahq7zRKCLP0nr6D4UK1/X83WRQuxfdc8lYItGishfWNdwjOT27jYOt/pqn9Mb+abH 0Okk42v+VRg5NzGEsbut97YQdvr83v/EEnguQGFYclbede5R+FVuhbFFkgOsujpUf9s8 aUENpLkNYK6r+pSgPELbQ9z9DhWf2fmUb6vcAjTS3oZ8fG4I5FIC5uwbjhphSMX6NUgc 8FC3YhJylh6JGtglAJ6f/iRpxdwC01UYCdxzvr8p0MEOJDbjzL77h7Jro/yuse9eUYRu AgEPmkTCcSbgnNjT4aHejjn25Kb6yCOy/xalOBupPlBxQIzIvLa1azdieuOb2NKo+S+H pPdg== X-Gm-Message-State: AElRT7GOUOOfqslaKLtKx7YScCq+bt5TepQTZFlyA4u31YSEpL955fn2 4I0Saa52LUf5UVg130j0u0jCmA== 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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;