From patchwork Wed Feb 5 15:39:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366467 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 2C7351395 for ; Wed, 5 Feb 2020 15:40:30 +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 0BAD720730 for ; Wed, 5 Feb 2020 15:40:30 +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="Jr9o9t2z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BAD720730 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 CFBC989CFA; Wed, 5 Feb 2020 15:40:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc43.google.com (mail-yw1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF3FE89C27; Wed, 5 Feb 2020 15:40:13 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id n184so2769031ywc.3; Wed, 05 Feb 2020 07:40:13 -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=Jr9o9t2zLRb4kSWg6/NfVYteb+w1FcSSbnWBaBHw/UNkrLq4HJre7jBKtPd/a0V/gG ro4KSPlduebgx3MobTH42vDFasL8tHJIdOoT8S4x2cwPf6NOzDREh0Y8gnw34rZBdiHk r5TggbzkXHDlCjvJRnb5gDj6um6BgdbmULDn80rNbXk1lSLjIp4+HgIA3/hSieMOsS5E BbvFt6bleG5EE9sturt3EnZ9D3862PpRnMW+rwj2N8rsb3aFe5pbENi+jEpeoxGCotOe Wp5U4EjdRjzJGqPmofrZCFYwlCRDS15MCwf7qUmC+MHeY+YEVBDrgCWPFdOYxvnWgKMK Rolw== 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=KmX4hizkEmoWP+T8bh5kM9HNsWG1XzXa+zhzinK36vDWE668lHGOhfjUywPYYjHH7u NxsI0fuVcRPzf1RmpJCV0qOYw0H8pf2QQBSQrPxUM3Gv7Tv3BMQ8x+IOU6SQ2mo9hdgQ TPzSek+1A5lk8cukwOv1n22hPBwxuNUlwX6JptPyyoF5KBTbIQYKu8SdPeqs+sPwwKy8 NKbT26NlhLHenUEXZuPIqwgOLaLwmP+O2R+IUAQUzaKmI6MbFhpfK9fPrDbNdHvqHPgX hCTDZXrGcu9s19zFSGpckqscN/r4kBX9tOqrVAkFYvlLicbzPQHfXVf0ZrOFVo1ZyJl4 q1dA== X-Gm-Message-State: APjAAAWL3elAGALpL47I5AAnd9tjFzVqIDMdSb8s66vZSoJNa5H9CXcA 2Mf6pNEsPSfW8QxtF0x1oHh6G3mm X-Google-Smtp-Source: APXvYqxft52W8PKn6ZjuWWbVlRr96a/W/AtJBgcu6VexT5QhVoHwSVPUn3ytADI/ypXM/Ja0ERkCpw== X-Received: by 2002:a25:2e12:: with SMTP id u18mr28463905ybu.250.1580917212668; Wed, 05 Feb 2020 07:40:12 -0800 (PST) Received: from tr4.amd.com (atlvpn.amd.com. [165.204.84.11]) by smtp.gmail.com with ESMTPSA id q185sm61256ywh.61.2020.02.05.07.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:12 -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: Wed, 5 Feb 2020 10:39:49 -0500 Message-Id: <20200205154000.536145-5-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205154000.536145-1-alexander.deucher@amd.com> References: <20200205154000.536145-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);