From patchwork Fri Feb 7 19:50:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11371065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8A57109A for ; Fri, 7 Feb 2020 19:51:24 +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 A7034222C2 for ; Fri, 7 Feb 2020 19:51:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y8tbKX9V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7034222C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9373C6FD6F; Fri, 7 Feb 2020 19:51:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5A736FD6C; Fri, 7 Feb 2020 19:51:10 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id w8so273951qts.11; Fri, 07 Feb 2020 11:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O1jdP4CEORovm2VR+Fw+/VJ73Y3rqRpk3hpguLeOylg=; b=Y8tbKX9V0bsUrlHlP5JVNVW4khKM/2I1ukPFr1qJTFP01ucuoOz8FPxAMmVyV5Vl7S FYA31LEMS4V4nayk+YiIAKVnHN7p9U2ocUgFXSM7rq33DD3jJ4Um9vawMDktu5KcKbb7 wqvzZ0Q51ue2Y0apuroXUOr4g6NJ4xwQDt9qNNlJn0AuyVyLv9IOVixHw2v/agW6qhOO W1X4qTvF+NbWhgyIStjxLQlXKWmnHXYmnfRhzEo7RL5Pvh4bFe/nbJkWjaAhcGWPvtku AMKQDyt/J5z6PU36ONL0f+udCR/xUGi8jrkggS00Di8E4TJNScbMmS9ZU7jQqsRlQUfy xOCw== 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=O1jdP4CEORovm2VR+Fw+/VJ73Y3rqRpk3hpguLeOylg=; b=eaigP/TPcbGTaLNh3E3CFcC0CpKjOfHA57SkG75cGOgLA4quoHCYu4ptjvIFQSJItH GzudxdeBFbiXL5WC8hBCoRqLjY9fBonMaJh9SIskPqbsR6+nZ1kEIn+afHriqT4SDdgB C5sh+WmTiihkAh8I/18nrHCB3cx+2jzvs7I56TWL+uH9IafCiByl/4C11cfR+Bfr++Pz wZ4VXbSFTSI7jRZXaVgWl0oG1MSK2g9yQczLeEza+DrU04kmjDtLQZzhAupsecGyTEfH nrCv9ATQnbSyJxpnlWyLrnFTT6gtOsl20em4EVL7fAdUmaxQZ5O+WFVZthTrDU0t4rmJ H92A== X-Gm-Message-State: APjAAAW1nfLTCGM2IXKkmkpluqw0mIF7aAitObTNl16u8JbhG2ND9uzI q7GzO39rqxdayiynwqztTe8ZbGqm X-Google-Smtp-Source: APXvYqw57GQhOzatx6DLONDFO41YN9OoHqT2jEg9qJZ1NdjhVGvY+eq793wdQ9XcplLR3o6nsiWsrQ== X-Received: by 2002:ac8:5215:: with SMTP id r21mr471203qtn.77.1581105069809; Fri, 07 Feb 2020 11:51:09 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51:09 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 04/15] drm/amdgpu/sa: move debugfs init into core amdgpu debugfs Date: Fri, 7 Feb 2020 14:50:47 -0500 Message-Id: <20200207195058.2354-5-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for SA (sub allocator). Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 ++----- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index c1d66cc6e6d8..84c5e9f23c76 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1241,6 +1241,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) return r; } + if (amdgpu_debugfs_sa_init(adev)) { + dev_err(adev->dev, "failed to register debugfs file for SA\n"); + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 6e0f97afb030..abf286f2bc5e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -48,7 +48,6 @@ * produce command buffers which are send to the kernel and * put in IBs for execution by the requested ring. */ -static int amdgpu_debugfs_sa_init(struct amdgpu_device *adev); /** * amdgpu_ib_get - request an IB (Indirect Buffer) @@ -295,9 +294,7 @@ int amdgpu_ib_pool_init(struct amdgpu_device *adev) } adev->ib_pool_ready = true; - if (amdgpu_debugfs_sa_init(adev)) { - dev_err(adev->dev, "failed to register debugfs file for SA\n"); - } + return 0; } @@ -421,7 +418,7 @@ static const struct drm_info_list amdgpu_debugfs_sa_list[] = { #endif -static int amdgpu_debugfs_sa_init(struct amdgpu_device *adev) +int amdgpu_debugfs_sa_init(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_sa_list, 1); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index 26a654cbd530..7d41f7b9a340 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -330,6 +330,7 @@ void amdgpu_sa_bo_free(struct amdgpu_device *adev, void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager, struct seq_file *m); #endif +int amdgpu_debugfs_sa_init(struct amdgpu_device *adev); bool amdgpu_bo_support_uswc(u64 bo_flags);