From patchwork Wed Feb 5 15:39:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366461 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 E9269139A for ; Wed, 5 Feb 2020 15:40:20 +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 C7D5720730 for ; Wed, 5 Feb 2020 15:40:20 +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="fRjabsYo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7D5720730 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 A8C6E89C13; Wed, 5 Feb 2020 15:40:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3EC489BF4; Wed, 5 Feb 2020 15:40:10 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id b81so2691829ywe.9; Wed, 05 Feb 2020 07:40: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=18PoEPWuFM2KYsBe3wCA6P7dSJZNgZDnsgACDtqLcBc=; b=fRjabsYoK+Gy0jnQqVmuyA7LWZcmg/JIqUwD/Gal/luY1lmeNdgPDqxh5Uj9b3twtL wDKDOAfckPWn/+8MIgv8+KR635GcDyZmtTKXnJ0ueS8ktFwE74OYGUG0g19aWPlOJ2kQ 4OIcEjBSzwwcWjPQ6Ag/U1aXrCarRdh++l/QUa+F8Z5ZKj26u5Bdm32dFEA4Dv/eoNOK lkXgWbtHd3uC7JA3TvCND4dGSfCcDf4cdS7QlmIfggVF3TP1dbZf9bhQERF49+z3AIIi Djo1ydRGdw8Tu0jsW8vydimH4DXNIDrZLPJuXFtVcmyM9gwv88MF1PXdN1uUMqFhIrMD w3IQ== 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=18PoEPWuFM2KYsBe3wCA6P7dSJZNgZDnsgACDtqLcBc=; b=L7jaSYPVPs4HEBU/p1B53geTXkj0tWXmWjP7T9we12TdjIgETQVsDJEZb6Rk4lKM1R h70BDAAGxfMt2Isbi56XU71VG7wGu1UkMD7u5Xs34IoWilm7jGZ6o7L+9oPau0T5usFI kFot19y5zHoodL3equdRy5Yyhi5SplbXnGNhaL8j+8fnF3glazS9h5/fbQUorJtPYvQB gv/H9g7Za59Fnkv9W88oiHnqUgl1uZ3CXT39giL7TFolBl/PcvfAV0wh/Xpw/brtTn1t ry4fy5dSj0IjmxNp8TZGasiUdyjw9j7fXgEp/VNWBcZ37ZBy+iTDP97ty4vnXX9SEGJ3 WIzg== X-Gm-Message-State: APjAAAVWva4tR7J/hNR+mKHaX7jbQaioMgnHamxOLOjsp3N5SiOHFHxJ CYJMnI2O+vMn3/hzGjeGKLJ5AARR X-Google-Smtp-Source: APXvYqxYX576j9aUzNj97r6A/lC8JEIo57EwOzsXf/aDvjHfMlbPVD5V3Gu1T9aOC70PjAd1AIqIUw== X-Received: by 2002:a25:6b52:: with SMTP id o18mr29508776ybm.167.1580917209780; Wed, 05 Feb 2020 07:40:09 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40: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 01/15] drm/amdgpu: rename amdgpu_debugfs_preempt_cleanup Date: Wed, 5 Feb 2020 10:39:46 -0500 Message-Id: <20200205154000.536145-2-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" to amdgpu_debugfs_fini. It will be used for other things in the future. 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_debugfs.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index f24ed9a1a3e5..58b5e1b4f814 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1229,7 +1229,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) ARRAY_SIZE(amdgpu_debugfs_list)); } -void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev) +void amdgpu_debugfs_fini(struct amdgpu_device *adev) { debugfs_remove(adev->debugfs_preempt); } @@ -1239,7 +1239,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) { return 0; } -void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev) { } +void amdgpu_debugfs_fini(struct amdgpu_device *adev) { } int amdgpu_debugfs_regs_init(struct amdgpu_device *adev) { return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h index f289d28ad6b2..b382527e359a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h @@ -34,7 +34,7 @@ struct amdgpu_debugfs { int amdgpu_debugfs_regs_init(struct amdgpu_device *adev); void amdgpu_debugfs_regs_cleanup(struct amdgpu_device *adev); int amdgpu_debugfs_init(struct amdgpu_device *adev); -void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev); +void amdgpu_debugfs_fini(struct amdgpu_device *adev); int amdgpu_debugfs_add_files(struct amdgpu_device *adev, const struct drm_info_list *files, unsigned nfiles); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 8df7727815cb..3b09897eb1e9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3228,7 +3228,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev) amdgpu_ucode_sysfs_fini(adev); if (IS_ENABLED(CONFIG_PERF_EVENTS)) amdgpu_pmu_fini(adev); - amdgpu_debugfs_preempt_cleanup(adev); + amdgpu_debugfs_fini(adev); if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10) amdgpu_discovery_fini(adev); } From patchwork Wed Feb 5 15:39: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: 11366465 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 6A9771395 for ; Wed, 5 Feb 2020 15:40:27 +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 49DB620730 for ; Wed, 5 Feb 2020 15:40:27 +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="oOMUp2ec" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49DB620730 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 8D5AD89C83; 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-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 507C589C27; Wed, 5 Feb 2020 15:40:13 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id 192so2795588ywy.0; 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=VRZfR8evcWkAoQkq4CyMdOWNjI14snDPp/Kq1WJjhzU=; b=oOMUp2ecD7SH2M5Xf2bD7mhjx+9VCXeh/fhpStLfunYc1Y5CyVa6hEEx9kEjRfmk4o /JfStv70wR1dE9josL06wAFv0sS8OGd8z+Duokq9CTuNhwqJgfVrVYem9HUifs9uzbeI GZwiQCNNKI28/UjloeBSG9hL2cZvIHGmI0MVFnJZlnDJ2r56ksHpeblAYFvm8pvOSYp0 8DXWAGMMHJvPXInT2Sm/bphseoCI3/IMplvuuh4gMd84DKiDs6+2CpyzKyS8xXou8vqk W/N3ZbviJI0IHiR9xXxseuQjYHDLMfak/7omJ1Nt7Ekdejm09fKQThSF3/rqfDhLHOXW DxOw== 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=VRZfR8evcWkAoQkq4CyMdOWNjI14snDPp/Kq1WJjhzU=; b=as4kGNLtm29VDrEV3Ve+cNpOyJKnafzLNFAU8l/Y7NziCtFmYzxncLow9M5oa4Mm9o SwPlSiiwRGoVaZ6uU8rqo1K9TRwcQ7eOid2eWc1127bCRf1zhaybNmjfU4kcjKDeTIHo 5F2GXevRYPSYkhfGjuaDZA42A9k72lV4JxTMskM2Ah3GUhZHj6LmIgYgYtTn3rMdNhh1 8/ss5Zpxiozwe8fZghgLm4rGEBZRa84BgjuYcJnvDEUMz1eihMtMxehcHGMzyCEtC0el qlvUibFkfWdf+d8XxKzzxIs4OyYeYLaBC2MkXuVdjnuHUhlWAlgfgWetNWctj5HmDL8q 1cNw== X-Gm-Message-State: APjAAAV2ikj6tMmWe0AYOgMGS917QJJK+zzzk0tn2+0RHjbrtea6d5uk VxckMUXEAoz3e1UcQ1ET1E34dWgu X-Google-Smtp-Source: APXvYqxRgZJdVk9p5eiCZi2qPLYx+ZK+hpZvQH5xCJSTCSpeqz4Oi8p3Jrl5ogUJsHL2GsuMp/g4ug== X-Received: by 2002:a81:5ed6:: with SMTP id s205mr10736570ywb.91.1580917210836; Wed, 05 Feb 2020 07:40:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:10 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 02/15] drm/amdgpu/ttm: move debugfs init into core amdgpu debugfs Date: Wed, 5 Feb 2020 10:39:47 -0500 Message-Id: <20200205154000.536145-3-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 ttm. Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 10 ++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 ++------------ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 3 +++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 58b5e1b4f814..f49604c0d0b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1216,6 +1216,8 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL, int amdgpu_debugfs_init(struct amdgpu_device *adev) { + int r; + adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600, adev->ddev->primary->debugfs_root, adev, @@ -1225,12 +1227,20 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) return -EIO; } + /* Register debugfs entries for amdgpu_ttm */ + r = amdgpu_ttm_debugfs_init(adev); + if (r) { + DRM_ERROR("Failed to init debugfs\n"); + return r; + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } void amdgpu_debugfs_fini(struct amdgpu_device *adev) { + amdgpu_ttm_debugfs_fini(adev); debugfs_remove(adev->debugfs_preempt); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 56f743698868..0c35978626d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -66,9 +66,6 @@ static int amdgpu_map_buffer(struct ttm_buffer_object *bo, struct amdgpu_ring *ring, uint64_t *addr); -static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev); -static void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev); - static int amdgpu_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags) { return 0; @@ -1911,12 +1908,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) return r; } - /* Register debugfs entries for amdgpu_ttm */ - r = amdgpu_ttm_debugfs_init(adev); - if (r) { - DRM_ERROR("Failed to init debugfs\n"); - return r; - } return 0; } @@ -1938,7 +1929,6 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev) if (!adev->mman.initialized) return; - amdgpu_ttm_debugfs_fini(adev); amdgpu_ttm_training_reserve_vram_fini(adev); /* return the IP Discovery TMR memory back to VRAM */ amdgpu_bo_free_kernel(&adev->discovery_memory, NULL, NULL); @@ -2545,7 +2535,7 @@ static const struct { #endif -static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev) +int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) unsigned count; @@ -2581,7 +2571,7 @@ static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev) #endif } -static void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev) +void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) unsigned i; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index f1ebd424510c..2c4ad5b589d0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -133,4 +133,7 @@ uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_mem_reg *mem); uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, struct ttm_mem_reg *mem); +int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev); +void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev); + #endif From patchwork Wed Feb 5 15:39:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366463 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 4BDC3139A for ; Wed, 5 Feb 2020 15:40:25 +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 2ACDC217BA for ; Wed, 5 Feb 2020 15:40:25 +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="VSzMGAvS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2ACDC217BA 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 07B3589C2C; 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-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB18389C2C; Wed, 5 Feb 2020 15:40:12 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id i126so2716620ywe.7; Wed, 05 Feb 2020 07:40:12 -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=th/ZgWYLAtD7x9QpC0cnoR2MFKa3NkheKEaS9VVgMWk=; b=VSzMGAvS//PL7xbSDztFuuQWyJumKyHfkODfmCySaScTFerp8FoQrizTU+zvE48IVo vwfLiDQpbV7AztZ+x40kpSG+wz10cMntp0tm51gdqgy+GtJundvjaWG5yfJJi9fmfTZ0 nqJEj73DM7sml42pHob5jnxzXvz9iGG/JSTuTZr+C0as8CvkkgdCrRTaRh02ZSpTit8I VgabZ38kqE/LLPDicU0xTG6c4NVOWWgh2qGGwgSFt43WRpXGZrsgzN0W4pnrYanEEJic 09JZKWiSluIMCchQMSkoJA344MHSXWRhkTk7rMy37qTqankU4JfNFm7FdHbamQyHwQuD Ieew== 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=th/ZgWYLAtD7x9QpC0cnoR2MFKa3NkheKEaS9VVgMWk=; b=tqtD6cGbz3DyzMTbra8RxDpbf080XRTALwEYnAvBqsOXJ/DMzN0vn5grGPkQfSlt2N 24rqj4U9WePObuzLYSGTsc83zhk4w+L1Ncv+yQpG0EK5LAyjsT0IWcSLcRe7jGqZm2Kn 2vQRccI4npJpWa0S8Be7Dy6fbwxgiMyXY1a6wjDePOzx/5Ldzhqx5Rfv5cvivY4dvmo6 wUZiKnbgnbS9an9KI9JrIQuB6ofp6r9ZNl0cNHlAkbZmMMlwScMhvZqpZR8NvuyT4MUh YWJpslO5JZuRLftZL/lqj2MNe995jZow4mw4cp+B39fg7inlxsvLno5iMfb6AdgiUt0F G+bQ== X-Gm-Message-State: APjAAAWwM2booqx3qheIrTa6zDf0X4utC5sTzvuD78o7UGTN/AMYzrqY 5ekR1VAvMsEQPFlQBamVOCrJhf9Z X-Google-Smtp-Source: APXvYqwgYoSUbTgaGOYN99Mls7XwiKBAyLBwxmkMvgzlU7i7pPOMI1PJ5VLmdadkJuLN1jMOssA3ww== X-Received: by 2002:a81:33d0:: with SMTP id z199mr11003643ywz.53.1580917211700; Wed, 05 Feb 2020 07:40:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:11 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 03/15] drm/amdgpu/pm: move debugfs init into core amdgpu debugfs Date: Wed, 5 Feb 2020 10:39:48 -0500 Message-Id: <20200205154000.536145-4-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 pm. Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +-------- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index f49604c0d0b8..c1d66cc6e6d8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -31,6 +31,7 @@ #include #include "amdgpu.h" +#include "amdgpu_pm.h" /** * amdgpu_debugfs_add_files - Add simple debugfs entries @@ -1234,6 +1235,12 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) return r; } + r = amdgpu_debugfs_pm_init(adev); + if (r) { + DRM_ERROR("Failed to register debugfs file for dpm!\n"); + return r; + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index b03b1eb7ba04..bc3cf04a1a94 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c @@ -41,8 +41,6 @@ #include "hwmgr.h" #define WIDTH_4K 3840 -static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev); - static const struct cg_flag_name clocks[] = { {AMD_CG_SUPPORT_GFX_MGCG, "Graphics Medium Grain Clock Gating"}, {AMD_CG_SUPPORT_GFX_MGLS, "Graphics Medium Grain memory Light Sleep"}, @@ -3398,11 +3396,6 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) DRM_ERROR("failed to create device file unique_id\n"); return ret; } - ret = amdgpu_debugfs_pm_init(adev); - if (ret) { - DRM_ERROR("Failed to register debugfs file for dpm!\n"); - return ret; - } if ((adev->asic_type >= CHIP_VEGA10) && !(adev->flags & AMD_IS_APU)) { @@ -3669,7 +3662,7 @@ static const struct drm_info_list amdgpu_pm_info_list[] = { }; #endif -static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev) +int amdgpu_debugfs_pm_init(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) return amdgpu_debugfs_add_files(adev, amdgpu_pm_info_list, ARRAY_SIZE(amdgpu_pm_info_list)); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h index 3da1da277805..5db0ef86e84c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h @@ -43,4 +43,6 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_jpeg(struct amdgpu_device *adev, bool enable); +int amdgpu_debugfs_pm_init(struct amdgpu_device *adev); + #endif 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); From patchwork Wed Feb 5 15:39:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366469 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 C8646139A for ; Wed, 5 Feb 2020 15:40:31 +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 A79D020730 for ; Wed, 5 Feb 2020 15:40:31 +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="U4a/P5Pa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A79D020730 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 D4A9789E0E; Wed, 5 Feb 2020 15:40:15 +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 9FEB789C88; Wed, 5 Feb 2020 15:40:14 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id t141so2671571ywc.11; Wed, 05 Feb 2020 07:40:14 -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=vuO2RgQIhRHrPoIOS6P9hpIDp5H+sQisyjrPWS+rotU=; b=U4a/P5Pa+vBXftLpzlpSMwczedmOpU2J/TfhGqQ1o18IplsEQp8TumrzOqL0BJ/Q6k PROfFdEiYBiWWGHJV21kYp+fZYNnYZTvyxis9lZnxvoXX+7nz1a8/JEfDzj2n7H9bIGl DC9eYYA2Jq6mNx6K6z1JmPVl25OqYPa/xUyVDOacM82XGfJwhS310Mg8drttx+PnR0tN 4lhCETTxkLolgf7yIKRZyXrxenVQrigWgWrvtFxNZhGh8kKRJx5wGJqSQLaspnApyLIc 9eXJ9bm173oJTfErF1lmqFoxciCQ5VznTJW040pGNB5EOu4B/j5hSHV5vKIVDzZ603y3 2/rg== 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=vuO2RgQIhRHrPoIOS6P9hpIDp5H+sQisyjrPWS+rotU=; b=aOguDcU44L4KfppA4TDyakyNhBN1R2a+TA4eUpzB9GBCx/bp1fNTTc42uWBwupLv54 4zm7qQXHnnCDbGOaC3La8QpiGnB8TlR4WkcnYlNEbN/jJYtr2KGvlUQEpWjQA6y3OF3B XLo8HGYvWvJ5oX3nwpPXIGyBynpakhwI/6Zrp4ehi2sXPjX2y1lID6OyfwT3n5CPoiQQ u/uDZxXWD3hOfaS9tfFnFgNaGQpqvgFGWmtHaEafd21BJZY/QjgsZxUswHtfkeUUSPvR Umei2nIXcZCUefsd8yqz4sLxz/oLrRpMM98x6NOiTBOtiwUf8/SpRDbH+APiWJawRDNV lJ/w== X-Gm-Message-State: APjAAAUtsMtWSKNST2kL4ay9LxBqeSZMWEed3xN+X3WSyU2rjanQ1W3i 7riR9c6mU5GxBy2mEjpHAu2FVRRJ X-Google-Smtp-Source: APXvYqxQ6fDoTlN4Q2Re3os87V+GSEV6xqD2QUXsfB2wD3xB2t65GKjWMEIHyR0Cog7cXpoZvMvzBw== X-Received: by 2002:a5b:144:: with SMTP id c4mr31744112ybp.371.1580917213687; Wed, 05 Feb 2020 07:40:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:13 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 05/15] drm/amdgpu/fence: move debugfs init into core amdgpu debugfs Date: Wed, 5 Feb 2020 10:39:50 -0500 Message-Id: <20200205154000.536145-6-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 fence handling. Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 84c5e9f23c76..bcd10daa6e39 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1245,6 +1245,9 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) dev_err(adev->dev, "failed to register debugfs file for SA\n"); } + if (amdgpu_debugfs_fence_init(adev)) + dev_err(adev->dev, "fence debugfs file creation failed\n"); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 3c01252b1e0e..7531527067df 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -503,9 +503,6 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, */ int amdgpu_fence_driver_init(struct amdgpu_device *adev) { - if (amdgpu_debugfs_fence_init(adev)) - dev_err(adev->dev, "fence debugfs file creation failed\n"); - return 0; } From patchwork Wed Feb 5 15:39:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366471 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 38E1B139A for ; Wed, 5 Feb 2020 15:40:34 +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 180BE20730 for ; Wed, 5 Feb 2020 15:40:34 +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="f/ixeOT6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 180BE20730 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 F1C5489DE5; Wed, 5 Feb 2020 15:40:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6B1689E35; Wed, 5 Feb 2020 15:40:15 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id l5so2751271ywd.4; Wed, 05 Feb 2020 07:40:15 -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=2OA8lB2OrGh8nJkA0X7sKAlsz1UEuNurcUSKsfyXOw8=; b=f/ixeOT6fnzJFPCmD2pJnSq0PAib1LY0yliODigYy6EvY2/vTZ3cf9c0TKTnBoajSj iWZhzfsRaJ8iBEelVMSEUlMMQQ/BJmlsi6xLZh3TLGwmpT06ybZTCAUviLa1q1yqG14M oYHQQ/j9fxwm4oO/LVdQv1CoUh7COvpMvQXj5rGHLN7B9n88TR3KcaG7N6uNuL2LSqUR xdjTq/k+FX+y4fsiXIQIVvGf0SbjQcDZmDJ2d0Siy1LPsh0KAsP2mQu0kr3IWp3aJh9z gfPfCIibNs69/U79KCi7keEQxG6y8FolyXzXQg9EXNwHMDSyeJ5UC9E2RgGkHm6B4LC2 6IzA== 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=2OA8lB2OrGh8nJkA0X7sKAlsz1UEuNurcUSKsfyXOw8=; b=YSq6zFw6tXE2OQ5vF3fYRLkQ26sTlOgYAhN+E8fI9u+zaeoC8moKKNfeetCOr16ygU tfth0gMNn+2cxrsc0FB9UwKYl6Q/+ygdK+x4aUdcteNFmCfsdR8UdarDVTIV7gtMbUSf rmO11CpCop/1zggmx26zG5AzzLvuRL2wAhSKJYNl6krC8awhCrJcAW9AiQqc11UZTxeZ hLtPcFU0+Hqo/33Cbx4Cc8+2YobXeqMnbXOpO/YfJ2KuvIQlbRrf43LgODM7tdsLvCmr SGs8zhwC9J8HRrlmv2dbL0RuKLJL4elarBqWnWk9TMnsV0RYEqWhFRhkYUHu2q/XiA/n h24g== X-Gm-Message-State: APjAAAVCU0jkKgnazN2AuloTCwtoL9H3/D6Hea6QUYQalVlx7+VBiWqH DpPjXaXMduz+UYkR1ZCpCLKH3B4I X-Google-Smtp-Source: APXvYqzNPGWqXj/B4XVQY8UcxPVqUcF17G3wP9DtZ6QwOh44gN4xrGxBE0em2p9IOAIGuNU8vwR+wA== X-Received: by 2002:a25:868e:: with SMTP id z14mr29422720ybk.413.1580917214634; Wed, 05 Feb 2020 07:40:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:14 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 06/15] drm/amdgpu/gem: move debugfs init into core amdgpu debugfs Date: Wed, 5 Feb 2020 10:39:51 -0500 Message-Id: <20200205154000.536145-7-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 gem. 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_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index bcd10daa6e39..cb7db7edfc3f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1248,6 +1248,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (amdgpu_debugfs_fence_init(adev)) dev_err(adev->dev, "fence debugfs file creation failed\n"); + r = amdgpu_debugfs_gem_init(adev); + if (r) + DRM_ERROR("registering gem debugfs failed (%d).\n", r); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 3b09897eb1e9..64a275664c72 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_gem_init(adev); - if (r) - DRM_ERROR("registering gem debugfs failed (%d).\n", r); - r = amdgpu_debugfs_regs_init(adev); if (r) DRM_ERROR("registering register debugfs failed (%d).\n", r); From patchwork Wed Feb 5 15:39:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366473 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 0148A1395 for ; Wed, 5 Feb 2020 15:40:36 +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 D478D20730 for ; Wed, 5 Feb 2020 15:40:35 +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="FcaJfdEb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D478D20730 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 6F7446E219; Wed, 5 Feb 2020 15:40:18 +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 D9F8B89EEB; Wed, 5 Feb 2020 15:40:16 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id 192so2795828ywy.0; Wed, 05 Feb 2020 07:40:16 -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=bkYRQmfYepBStIDdFbUMKhxcQfkGtWaInDgOAE3QheI=; b=FcaJfdEbFBtxNjMOuOSLT7Iy3Bscftke9zGm4bTAj+hStl0FX/fjf/seVkfh+JldbW WsxZ61sl15zGteV31pHrPJVbI8zHdIMt7v0oC7IXqW25oRRPYwFU8DvBXxnlq8B9atx5 ahfYk6Tncg8yLzkjmRUJThAJfxjqPDbDV7/Y0ZtUhoCN5NoA/Jith/t5/DiM8HJbngw5 rs9FxhDgBr7rqUq2h66cKS+Vr/KJeIpUhT2ksNKzV38FCSeemL7l7Qbr8RU9Sinbbn2H 839NYSmvK+4b/ORxB07UXHbJra4JhrCtgBncF7HgaAFSbFyZaMxtmG8lNRlZ6G0afA/7 pkew== 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=bkYRQmfYepBStIDdFbUMKhxcQfkGtWaInDgOAE3QheI=; b=FJa9JqgNxn7igRzGUQR6xHkR5bZcj0y/vctFQasr7boWSxrhxPRwBQSZSnSE7TBCnC 7aVOk6ZlmXvPmKU+WotyuHC+83CqOvgAW2bToJg1rnvlrNWKEgBxwa6UbPl9Abqj9VhW wn90/t+I5eWWE9mC2C/dCNXytKDyBMwBe3lBfiu7kgarN0UbQj7yFn3VnSMjThA8EXYn JA/OKnX51QQV4hkTX0p64ubHYo4ej5YJiPpPYSW2ApBeYUbOZ1D0N7/BI6ZAMpC66lHO TJao1MIIW1dHCsq/yP8XFFHR5dXmS5uGIhrOCLuMubdZ6Gb2XQmsWD1fQNjsvha9Gjcd xA7g== X-Gm-Message-State: APjAAAWfRpP1SwbJ4hFhsCnhSTcV4oDZP4rQj/SZohQeKXt0EnBIIbnc zCaXyN31C8OU7HeXEK8gnLDG9hEJ X-Google-Smtp-Source: APXvYqykyvtAvsIDtqhme53U7k6Ed3SAv9zRptrt4IB6qc+JOo6zh9LkCPF9DFhldBH6SpSQFGTl6A== X-Received: by 2002:a25:56:: with SMTP id 83mr21901620yba.80.1580917215801; Wed, 05 Feb 2020 07:40:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:15 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 07/15] drm/amdgpu/regs: move debugfs init into core amdgpu debugfs Date: Wed, 5 Feb 2020 10:39:52 -0500 Message-Id: <20200205154000.536145-8-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 register access files. 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_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index cb7db7edfc3f..7721f1416cdb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1252,6 +1252,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (r) DRM_ERROR("registering gem debugfs failed (%d).\n", r); + r = amdgpu_debugfs_regs_init(adev); + if (r) + DRM_ERROR("registering register debugfs failed (%d).\n", r); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 64a275664c72..d84a61e18bf8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_regs_init(adev); - if (r) - DRM_ERROR("registering register debugfs failed (%d).\n", r); - r = amdgpu_debugfs_firmware_init(adev); if (r) DRM_ERROR("registering firmware debugfs failed (%d).\n", r); From patchwork Wed Feb 5 15:39:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366475 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 5DC3B139A for ; Wed, 5 Feb 2020 15:40:37 +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 3CAE720730 for ; Wed, 5 Feb 2020 15:40:37 +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="ECfgHskL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CAE720730 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 0CB0A6E9B5; Wed, 5 Feb 2020 15:40:20 +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 4627A6F615; Wed, 5 Feb 2020 15:40:19 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id f204so2687042ywc.10; Wed, 05 Feb 2020 07:40:19 -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=aG4tWD4Bf63nrdqVyzzXgsS9Nnk8tFLF0JhSz+Or+5U=; b=ECfgHskLmaXsNYSv+MjjVFTRpOlgi/ojYPNEnX2SIxhw6y09JOspu2C29YeLlvR6++ 2oJA6vFQcDPR9dzQV3Do4GS1LBLqpdZZBOpCHoxO/K7/OIePub2JAt/N9BV6lIjV1Y6B CnTpIOC2SFz3g+ma0V8MUMRUQKJdEtgDzgCVnY8GR37iow27nRluTl8vsqdv8OGNxIWv d3yMvIYXmVI2nVE5GzpdZsGKICUDhxxt2RSYnmNX6OGstaJfJnn1N3Iosv7LMMDLd+tN X1ZcWORfsVLRpAd23SFvm8Q7Ydn7PcDR0lS3kYoe6BauzGsI6irp3s5zWbWciIbcwiNi /cLg== 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=aG4tWD4Bf63nrdqVyzzXgsS9Nnk8tFLF0JhSz+Or+5U=; b=nkYmZQTR3LZAh261nsEUaHVj7fG3jcfEnftp8V9IYygEfAcjkk9MsI6Veww0cry9y+ 2xp5S96njH6xw2ZAX+fdI+729cJqUK2qslr4zumi4UZsuJ9qBvWar1kwZi1sDu2VKPoX zx59GD7mDO9lhmt7kKcwM0WG5QEsdNmg+ek2TVw8FX3/Xz2UyfCeAPhWiP/gJfoL1wxO Jq6nzbFmG86L4OV5HIIT1kes6uPGru0Lm6ES7lydHUpmoAPXpesOfJFdQHOvFFDMzaRc dTANntNITSngsjW8uqMDPK1s2XCGVPizqz3TlHZn6MczNtqHQRnf0lNM04ybmdpTCH+R 0GKw== X-Gm-Message-State: APjAAAVdk4fl/Q0lFWesqJGKuHjshCrbl6bIRMcWt9psi5aGEUfjKoSX vZZSJ4t3IxLOzDstHkRYyvFM1PeP X-Google-Smtp-Source: APXvYqw1RdLUprCAgQ+o5Tdwr6daV+5bxevxjuBibiJArC6L8VRXJ010+Bc+tQfMEaNf9VXCICmXWA== X-Received: by 2002:a81:30a:: with SMTP id 10mr10591751ywd.162.1580917216860; Wed, 05 Feb 2020 07:40:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:16 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 08/15] drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs Date: Wed, 5 Feb 2020 10:39:53 -0500 Message-Id: <20200205154000.536145-9-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 firmware. 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_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 7721f1416cdb..5bf43f20ec30 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1256,6 +1256,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (r) DRM_ERROR("registering register debugfs failed (%d).\n", r); + r = amdgpu_debugfs_firmware_init(adev); + if (r) + DRM_ERROR("registering firmware debugfs failed (%d).\n", r); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index d84a61e18bf8..4dc7145368fc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_firmware_init(adev); - if (r) - DRM_ERROR("registering firmware debugfs failed (%d).\n", r); - r = amdgpu_debugfs_init(adev); if (r) DRM_ERROR("Creating debugfs files failed (%d).\n", r); From patchwork Wed Feb 5 15:39:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366477 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 8FCC4139A for ; Wed, 5 Feb 2020 15:40:38 +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 6EDE020730 for ; Wed, 5 Feb 2020 15:40:38 +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="EdevR+P3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EDE020730 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 406CB6F613; Wed, 5 Feb 2020 15:40:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by gabe.freedesktop.org (Postfix) with ESMTPS id C95EE6F612; Wed, 5 Feb 2020 15:40:18 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id b81so2692266ywe.9; Wed, 05 Feb 2020 07:40:18 -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=a/BMDiqhoEnI0+MK5kOQbygtLUupSGYKuie/3X93O2U=; b=EdevR+P3Iyif5yfwy4JFeIp9wB+FzRYqGSXq600T6JXP3GdpIcA4I4n/+4eiX7FQlJ dOH1VxAxRBYj0y1QvqX3bstzDssFeIpggHvB3hk1KdFdsuoKxmwE5Jlr6I+fzam63eiJ z7WfFfMKL1YOW3Sxd2YmvfvLDshH5RcnBtUuN1H+7oGLTi5GtlRX2yG0tG6U6bCcRq9r vRV0jYqSikcnuKs/X6UjkSuqjx9tOFXKTfimxDpOWgouYbByxSdlV1bADK921/mQ/ZWY KtbIzhseO4TdX4dXBfdj970ptGEWO1vFT8RUl3S5w4gEpnKIbfIsAHVmKxlKNpQD4V+J /04Q== 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=a/BMDiqhoEnI0+MK5kOQbygtLUupSGYKuie/3X93O2U=; b=A9CvHGZgRF9OEfuhu/Ko+VNquo63qUrvkhA93GqrmPVyuSRK0lPessKvyUqOS2sOND MZbPfWKi4GPlPV2ByL0AJGltzvHDVGMpz6uafA7sLqrFDv6wvyY1Sl+M99+kkSs5nmfH iq41SdWTzzQkMkPSqr2byoZ0JPH8b5FrnsRMotilijcczrsYRY+Pgws+vjxfRYkruKma HDTH4Y14KRpL5uQb6gr9Zzjv5NnTRlD0BujlUF+NOxFYvpSP2cFmKnF13gf9oRjjHEjq /5Yx0oQPjWtSMmneH36XCJ1Rwt3cvB9xuAMUmls7kKy7ZRuGtXEHfpPclEZixPUUxSJC lVYA== X-Gm-Message-State: APjAAAWEvIESipuWfGcw6XpLsJqReGOCx8ccsdgduDMwRfWccpPbUDzJ gnyUCL/qnfpNUF147h9bvHa+w0w8 X-Google-Smtp-Source: APXvYqxLEDG4e6tKp4wml6acPUQqfij6SiRmirXX7SZhvulgLzQ/k+8C3DknpxsCbcmaVCcQ5aRuTw== X-Received: by 2002:a25:6b52:: with SMTP id o18mr29509409ybm.167.1580917217797; Wed, 05 Feb 2020 07:40:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:17 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 09/15] drm/amdgpu: don't call drm_connector_register for non-MST ports Date: Wed, 5 Feb 2020 10:39:54 -0500 Message-Id: <20200205154000.536145-10-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" The core does this for us now. Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 1 - drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 1 - drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 - 3 files changed, 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index a62cbc8199de..ec1501e3a63a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -1931,7 +1931,6 @@ amdgpu_connector_add(struct amdgpu_device *adev, connector->polled = DRM_CONNECTOR_POLL_HPD; connector->display_info.subpixel_order = subpixel_order; - drm_connector_register(connector); if (has_aux) amdgpu_atombios_dp_aux_init(amdgpu_connector); diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c index e4f94863332c..3c9f2d2490a5 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c @@ -609,7 +609,6 @@ static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev, connector->display_info.subpixel_order = SubPixelHorizontalRGB; connector->interlace_allowed = false; connector->doublescan_allowed = false; - drm_connector_register(connector); /* link them */ drm_connector_attach_encoder(connector, encoder); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index bd798b6bdf0f..50137df9cdad 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5839,7 +5839,6 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, drm_connector_attach_encoder( &aconnector->base, &aencoder->base); - drm_connector_register(&aconnector->base); #if defined(CONFIG_DEBUG_FS) connector_debugfs_init(aconnector); aconnector->debugfs_dpcd_address = 0; From patchwork Wed Feb 5 15:39:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366489 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 95377112B for ; Wed, 5 Feb 2020 15:40:49 +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 7395520730 for ; Wed, 5 Feb 2020 15:40:49 +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="IfBXGEUX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7395520730 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 E341C89C53; Wed, 5 Feb 2020 15:40:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38CE26F612; Wed, 5 Feb 2020 15:40:20 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id t141so2671904ywc.11; Wed, 05 Feb 2020 07:40:20 -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=4p9znhhB5vE3fVJEzAq+piHOIAc6BksjmnQcQMYSiD4=; b=IfBXGEUXp2lvRYs1SkeXpykPkiutBaGl9s0TFAU43GLO+gE2+lmKenzeAd0K/OlruC xTC3DvdI7vzHuTZbimKryvhfxf5HGZtxMdYZM8c9isde7DRpRhOf+IHhs245/ZuJ+o4S blCB419/qfqrasrEIo6CwTcdIdSELpiRgCqjLyaUcO9e3uP+KQA/tldFe9KbD1FLjDDX Q6eK8pImTB2ET7OqxVK+e6yLjjNVYDs9TCO+to1smHQFYTJ490ZeVjdND6io0SDQtfJZ tti4Gc6fzAFinKQBSOQN0lD1Y6ILxrIhayoBjOLd69E1dZ7RgzBAcioZSxP2zfMBFyk7 2T7A== 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=4p9znhhB5vE3fVJEzAq+piHOIAc6BksjmnQcQMYSiD4=; b=Bks+Mp2fvcguxu2H/HCGkT8B3cg6J2gaP6bCgy8ZmcjkIg30Lp2Kq7qbjyMnhh9wsC CzBdfZRUDy76/tfMWGbu7tX+r8foeA9PZLq2HTTGtcubIU2XI+tLh0hdnQu/ZlZkYhYD B/g4X6EA2SlE7tqbIjVvs01tr0FyLZPNokdUSx4B7v5faY29hfLrQOJKyVAUq2hmJtQF 6ypEV2dJgeHBiErDdltAP7yoYbLq9AQw4VHqeJ6hCFcO46xt2rD+aCba+9I4pCqnEDam on4UnAEODa/cPhwgaIIT29Od816tbASa96GPMGTECOnzeqrdZbzBRM4EnQeXgSpzLHZc 6IDw== X-Gm-Message-State: APjAAAXWG/LXb5GKE/OakeA9+xMgsCBIMTLpBwtrF5z/FuqNT1j17E41 ZD6fqNobdwYVnchRJHbquv44lUAT X-Google-Smtp-Source: APXvYqxamsgv+VcMAsj8GCx4BDfX31ChXSBAbgXpvtn8GfMmr7IkKaIrDZCYiVHrfJROvf2tkg8FXQ== X-Received: by 2002:a5b:ac9:: with SMTP id a9mr28450299ybr.307.1580917219147; Wed, 05 Feb 2020 07:40:19 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:18 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 10/15] drm/amdgpu/display: move debugfs init into core amdgpu debugfs Date: Wed, 5 Feb 2020 10:39:55 -0500 Message-Id: <20200205154000.536145-11-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 display. Reviewed-by: Harry Wentland Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++++++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 5bf43f20ec30..82d30bae2ba0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -32,6 +32,7 @@ #include "amdgpu.h" #include "amdgpu_pm.h" +#include "amdgpu_dm_debugfs.h" /** * amdgpu_debugfs_add_files - Add simple debugfs entries @@ -1260,6 +1261,11 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (r) DRM_ERROR("registering firmware debugfs failed (%d).\n", r); + if (amdgpu_device_has_dc_support(adev)) { + if (dtn_debugfs_init(adev)) + DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n"); + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 50137df9cdad..81c8d8c61d62 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -991,11 +991,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) goto error; } -#if defined(CONFIG_DEBUG_FS) - if (dtn_debugfs_init(adev)) - DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n"); -#endif - DRM_DEBUG_DRIVER("KMS initialized.\n"); return 0; From patchwork Wed Feb 5 15:39:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366479 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 6AE651395 for ; Wed, 5 Feb 2020 15:40:41 +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 49BE420730 for ; Wed, 5 Feb 2020 15:40:41 +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="JJcyIWSi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49BE420730 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 C5C9C6F619; Wed, 5 Feb 2020 15:40:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4276F6F612; Wed, 5 Feb 2020 15:40:21 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id l5so2751575ywd.4; Wed, 05 Feb 2020 07:40:21 -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=fYgUQEGMVG8JCE7r/RnH+xa7UiWLAqjsWw9UAiCffeU=; b=JJcyIWSiaM1vjLKNVUQjFIMeYRLbEbxfEEPKDCimhk3n7Vjpjq1uVYnMGKs+PKerWf zq7rAYwUoGF2NRJiRNT8BnaKNLsubx+wLQkwCmlKZXrOQqyiDvcvAwHiWngTuxwfaWtA VA1iFEI55rR/7yYfF4rEoqmBZngaUvgdprKXw/Ctp4oiQodGPN+jFMkuKo09MXnZCZWS J17yyOfXLIey3XD6R0ptxwjysMHR1nxZy2mumyhSJRmyLy05LNqUwRf9Q29tDx81bSBf QdTvwcfxPNNfzW79QxIWSzUsvoxVFeg4F5q04Jh46e8I6suu07RfX1An8CdPeh9EGjOD ULSw== 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=fYgUQEGMVG8JCE7r/RnH+xa7UiWLAqjsWw9UAiCffeU=; b=S+3+Q1dPfjZf+oNhi4iQm4telhVlXU5HsuG0Bouw5/1YI8yA90L6hDTS/RvctCAJ0n Te3cJLlfmWVkQ6/NZ6zXdvP36hczRu3SXuFDkOk99SwZyKAkUgTrJm+Vbs/4jkdjDu3S mF20ezUMzNYsL8On0unKUOHuWnoLHjaUgKKlJn/8ObmRa5Ax2sElWUOcxySH6sXB3mr5 PuoSAiE+0xvgGTJkeYTbMIWqanNq/8zDJJwUdcG8JGyDoGDi+kprawsQihykjnPMmCng tdxf9DQoXU2vh0RDkeekTNR45fA3QbAL65hAalg0LokvtvDEm5ApDXMWSLlBe7qrJ5uS 6njQ== X-Gm-Message-State: APjAAAXboSV+p/JnneYrebuUWe1mld9oKTiXwN3IqHlP2YHW+6RxUx74 IQmXXF/UzEu2zf21jsxYGwcrCcoI X-Google-Smtp-Source: APXvYqxcb8+JkBimWXJYiC7oGC4VU+t+A1fqsbrV3s1/45GvtoyTOrrAb4FwQnQNpTxrm9ZkA+kk1g== X-Received: by 2002:a25:8502:: with SMTP id w2mr27730073ybk.161.1580917220272; Wed, 05 Feb 2020 07:40:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:19 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 11/15] drm/amd/display: move dpcd debugfs members setup Date: Wed, 5 Feb 2020 10:39:56 -0500 Message-Id: <20200205154000.536145-12-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" Into the function that creates the debugfs files rather than setting them explicitly in the callers. Reviewed-by: Harry Wentland Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 +++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 81c8d8c61d62..af8155708569 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5836,8 +5836,6 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, #if defined(CONFIG_DEBUG_FS) connector_debugfs_init(aconnector); - aconnector->debugfs_dpcd_address = 0; - aconnector->debugfs_dpcd_size = 0; #endif if (connector_type == DRM_MODE_CONNECTOR_DisplayPort diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index ead5c05eec92..6bc0bdc8835c 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -1066,6 +1066,9 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector) debugfs_create_file_unsafe("force_yuv420_output", 0644, dir, connector, &force_yuv420_output_fops); + connector->debugfs_dpcd_address = 0; + connector->debugfs_dpcd_size = 0; + } /* diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 5672f7765919..3959c942c88b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -158,8 +158,6 @@ amdgpu_dm_mst_connector_late_register(struct drm_connector *connector) #if defined(CONFIG_DEBUG_FS) connector_debugfs_init(amdgpu_dm_connector); - amdgpu_dm_connector->debugfs_dpcd_address = 0; - amdgpu_dm_connector->debugfs_dpcd_size = 0; #endif return drm_dp_mst_connector_late_register(connector, port); From patchwork Wed Feb 5 15:39:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366481 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 1371C139A for ; Wed, 5 Feb 2020 15:40:43 +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 E6ADB20730 for ; Wed, 5 Feb 2020 15:40:42 +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="crW/sohT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6ADB20730 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 5A4656F61D; Wed, 5 Feb 2020 15:40:23 +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 352A46F617; Wed, 5 Feb 2020 15:40:22 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id l5so2751629ywd.4; Wed, 05 Feb 2020 07:40:22 -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=L1GhNIx2PtGdglnqeJklgMjlbabviVksiURR6t7YZis=; b=crW/sohTg4tf71e+LTEw20AP/18jsAWMuJpJmhTtVSkVZ+tIC8knq1onma+vbRy75i EW/0XLf3Fc2LXH0F0bY76xSOr8XMTqxkYt12x8KE1h2jQKjp6uc4SO1nImOO/K+NaBYQ l+MiNx2Qyu7VnfzjHDnEQ+PdSEzwXg/MUj6JWLMI/Upc4MCOI2/0LDdhHMQbivhHpccx CsUjg4PLmftjOBJ2p4ELBLtDT8PPLTi89+pDDiT4aT46Z/dK0TZqO11+O6XUb3KksKFh LzMbSItO2X5jYRuO7JrswoKkH4V+fUznaDfdVLPN3NXc42t8gyZgE8Qa9fwpZ0vEw2yt elnw== 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=L1GhNIx2PtGdglnqeJklgMjlbabviVksiURR6t7YZis=; b=V2DGlFhOZ85EyXuECeP3pFVQWW8n5+VBdLDixwd4eYPI82DyJaR3cyYpYT6DSXojw1 EUSAeKovImuN8Y/wy395ioTjaWL3whM8W5jco3fl1GgipT9El2g0shvtWmGlmKjIcOVo IsLlbviAn2zaCznRTb9ix7QpEYn7HcT2272eMzcIRxEHcdFo1/NFSRZhxOq4H2JcBasZ 0xx6y44tQtGQsaTXG4VvUrS7cCq3L+CeLhPiFx7UA8lGzVGpIbipG5NJeoZIY+N/NDTd G5ZYDkGG31A2zb8pif/ZIeIMseYB60xtGQGMnK478ozfAfE0Pc65qSQQc3DvR1tFKllo BzSw== X-Gm-Message-State: APjAAAXAbZnUzbMM+8u20UrwbG+irxMlMwXTPHVXZH3JoAkY7O0vjYT4 AG4Y+NGYH7M84e1ZtDts9SBFuDZY X-Google-Smtp-Source: APXvYqxJT2hnjCnK0y2binaiQ5hGaB1YpTPQxxislAp68vH+gunHFDaBLTZuInr1SLscODK9V5sijw== X-Received: by 2002:a25:868e:: with SMTP id z14mr29423185ybk.413.1580917221229; Wed, 05 Feb 2020 07:40:21 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:20 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 12/15] drm/amdgpu/display: add a late register connector callback Date: Wed, 5 Feb 2020 10:39:57 -0500 Message-Id: <20200205154000.536145-13-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" To handle debugfs setup on non DP MST connectors. Reviewed-by: Harry Wentland Acked-by: Christian König Signed-off-by: Alex Deucher --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index af8155708569..b6190079ed3f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4486,6 +4486,19 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector) return &new_state->base; } +static int +amdgpu_dm_connector_late_register(struct drm_connector *connector) +{ + struct amdgpu_dm_connector *amdgpu_dm_connector = + to_amdgpu_dm_connector(connector); + +#if defined(CONFIG_DEBUG_FS) + connector_debugfs_init(amdgpu_dm_connector); +#endif + + return 0; +} + static const struct drm_connector_funcs amdgpu_dm_connector_funcs = { .reset = amdgpu_dm_connector_funcs_reset, .detect = amdgpu_dm_connector_detect, @@ -4495,6 +4508,7 @@ static const struct drm_connector_funcs amdgpu_dm_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_set_property = amdgpu_dm_connector_atomic_set_property, .atomic_get_property = amdgpu_dm_connector_atomic_get_property, + .late_register = amdgpu_dm_connector_late_register, .early_unregister = amdgpu_dm_connector_unregister }; @@ -5834,10 +5848,6 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, drm_connector_attach_encoder( &aconnector->base, &aencoder->base); -#if defined(CONFIG_DEBUG_FS) - connector_debugfs_init(aconnector); -#endif - if (connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector_type == DRM_MODE_CONNECTOR_eDP) amdgpu_dm_initialize_dp_connector(dm, aconnector); From patchwork Wed Feb 5 15:39:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366483 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 C9E73139A for ; Wed, 5 Feb 2020 15:40:44 +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 A93C220730 for ; Wed, 5 Feb 2020 15:40:44 +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="N1Lb9j6m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A93C220730 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 375496F61E; Wed, 5 Feb 2020 15:40:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F3996F61C; Wed, 5 Feb 2020 15:40:23 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id 10so2736035ywv.5; Wed, 05 Feb 2020 07:40:23 -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=enniatpckRADBj2aVtvb6jb0E3OVi1vsmz6khollcx8=; b=N1Lb9j6m4IbU8yr6RUp1P3QoDzDavaMPCo+lHTRdkDXEMwl0vwKObXImcihPvz5phf ey7ZR53ojmhwfs3LUbuKKWXSZmCpQrazfEzcnD0+3Ps9FyXwWY3hf3tZqYHQAPA3E5h2 +NVfh3WSDFCPkSIIp5N9zzMPR6TTiapzEmOeswFVT0M+ZWr30aLhX51c5creZBkw2Or5 UaER1n9hSYO9qw9qZsEZgAnXLhSjPzAnNO9RQZ87EOdqD/j4nT1EVLX3cFUzTtF2ZaEq M6ATbRWW0AEa97GK/lHnZURALjd7cj5GCLKUbymCvvny+Rf6K5GHlzew4zD4QeeTtJVA g3dw== 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=enniatpckRADBj2aVtvb6jb0E3OVi1vsmz6khollcx8=; b=TS7stQP9QYm61YMCuo+kszGqhihyg23iXbYPon0qflmEZo3/ZOsGGgZFrhm404BHqk r4ZfyyLeN79QUyr99qLHUvOOi3dD4VFWbckAMFy0tqne9X42xEWhJC4d28Qo/49CwM3F LC7yRbpelOd1INSTQxmjRHjcA9Y8BK5ZqKt5p01TMjMiiCO0ecUhTH8CqWEuE++et839 PRHNj622uvutHSqWQTrxEXn31kUbtXch4nNc2IXVPeNlZir8Z/6zEntvIEbRsm2Qen1Q 41CPtCphnQB9IeqEaJNvj4eZbXb9R9m5t0yZlGl3jUuJ3jZOesr/DEmVFt23bpjtMnip zvxQ== X-Gm-Message-State: APjAAAVosZ08g+gaBm6+GOt5PSen1/psZjgj/D222IYdhS93yGGRHANL 4uxbdp+wIp8Gsf7UivrL8rvBwp/f X-Google-Smtp-Source: APXvYqzFuHcrnDJy6Cg7+uLy6snqo+t/WAxG0oKLEhzce5UBDSk2SELvEjXBO4TMCyBa7UARVjiYLA== X-Received: by 2002:a25:ce4d:: with SMTP id x74mr28606490ybe.340.1580917222184; Wed, 05 Feb 2020 07:40:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:21 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 13/15] drm/amdgpu/display: split dp connector registration Date: Wed, 5 Feb 2020 10:39:58 -0500 Message-Id: <20200205154000.536145-14-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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Split into init and register functions to avoid a segfault in some configs when the load/unload callbacks are removed. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 10 ++++++++++ drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 8 +------- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 ++++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index ec1501e3a63a..635f6c9f625c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -1461,6 +1461,14 @@ static enum drm_mode_status amdgpu_connector_dp_mode_valid(struct drm_connector return MODE_OK; } +static int +amdgpu_connector_late_register(struct drm_connector *connector) +{ + struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector); + + return drm_dp_aux_register(&amdgpu_connector->ddc_bus->aux); +} + static const struct drm_connector_helper_funcs amdgpu_connector_dp_helper_funcs = { .get_modes = amdgpu_connector_dp_get_modes, .mode_valid = amdgpu_connector_dp_mode_valid, @@ -1475,6 +1483,7 @@ static const struct drm_connector_funcs amdgpu_connector_dp_funcs = { .early_unregister = amdgpu_connector_unregister, .destroy = amdgpu_connector_destroy, .force = amdgpu_connector_dvi_force, + .late_register = amdgpu_connector_late_register, }; static const struct drm_connector_funcs amdgpu_connector_edp_funcs = { @@ -1485,6 +1494,7 @@ static const struct drm_connector_funcs amdgpu_connector_edp_funcs = { .early_unregister = amdgpu_connector_unregister, .destroy = amdgpu_connector_destroy, .force = amdgpu_connector_dvi_force, + .late_register = amdgpu_connector_late_register, }; void diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_dp.c b/drivers/gpu/drm/amd/amdgpu/atombios_dp.c index ea702a64f807..dd1e3530399d 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_dp.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_dp.c @@ -186,16 +186,10 @@ amdgpu_atombios_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *m void amdgpu_atombios_dp_aux_init(struct amdgpu_connector *amdgpu_connector) { - int ret; - amdgpu_connector->ddc_bus->rec.hpd = amdgpu_connector->hpd.hpd; amdgpu_connector->ddc_bus->aux.dev = amdgpu_connector->base.kdev; amdgpu_connector->ddc_bus->aux.transfer = amdgpu_atombios_dp_aux_transfer; - ret = drm_dp_aux_register(&amdgpu_connector->ddc_bus->aux); - if (!ret) - amdgpu_connector->ddc_bus->has_aux = true; - - WARN(ret, "drm_dp_aux_register_i2c_bus() failed with error %d\n", ret); + drm_dp_aux_init(&amdgpu_connector->ddc_bus->aux); } /***** general DP utility functions *****/ diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 3959c942c88b..a4e6f9d39e12 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -155,6 +155,13 @@ amdgpu_dm_mst_connector_late_register(struct drm_connector *connector) struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector); struct drm_dp_mst_port *port = amdgpu_dm_connector->port; + int r; + + r = drm_dp_aux_register(&amdgpu_dm_connector->dm_dp_aux.aux); + if (r) + return r; + drm_dp_cec_register_connector(&amdgpu_dm_connector->dm_dp_aux.aux, + connector); #if defined(CONFIG_DEBUG_FS) connector_debugfs_init(amdgpu_dm_connector); @@ -484,9 +491,7 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, aconnector->dm_dp_aux.aux.transfer = dm_dp_aux_transfer; aconnector->dm_dp_aux.ddc_service = aconnector->dc_link->ddc; - drm_dp_aux_register(&aconnector->dm_dp_aux.aux); - drm_dp_cec_register_connector(&aconnector->dm_dp_aux.aux, - &aconnector->base); + drm_dp_aux_init(&aconnector->dm_dp_aux.aux); if (aconnector->base.connector_type == DRM_MODE_CONNECTOR_eDP) return; From patchwork Wed Feb 5 15:39:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366485 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 202B01395 for ; Wed, 5 Feb 2020 15:40:46 +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 F33F920730 for ; Wed, 5 Feb 2020 15:40:45 +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="D1id+10V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F33F920730 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 583C66F620; Wed, 5 Feb 2020 15:40:27 +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 5A0CD6F61C; Wed, 5 Feb 2020 15:40:24 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id b81so2692583ywe.9; Wed, 05 Feb 2020 07:40:24 -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=GOilm1/CsDBCf3E42JXNjJcgzGp8rKiY6F4CBtn0mq8=; b=D1id+10VoAB28Sww/UTsyMRsZ4B/10aY/WgwqhFL/1aWi7jOfgGtsvgXeZerHOoPqK 0faPO0tpRXFQIzoCOo4v4J89BSLdW4HcDA5v22VXFTFOKTLZu+7RLZ9A0scRO+I3TrhK E4vhw6BDdhrx7dUIL/IidHrQIW81H8J9nUykCTuJsn+ayb2/PBUo4oFzqtwrNGpOBiqI i0/DkMtucfMFL+9rChMk0WUOHC+IxKunwy3ffDKX2cB+GDfkfLaZeSQWvQwqkl62Ki+n NGcUtAA+++9udOgnYRu88y8pKk/ca/5j1gIghg5PM0CZsqIdO9Z44HJ55BcTSOCdyhwX 9Exw== 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=GOilm1/CsDBCf3E42JXNjJcgzGp8rKiY6F4CBtn0mq8=; b=dzOJG8IDxpWGqPTNx8HRLFRYUn/7x9m3ONNOInDK6I9gOOrOZUaogP/YLq1wK/ZyLr zsphtnFTWyaxWhbw5hBx0TogtERDrjCOOBqQjV6dZ1euN/fcJ1n6bsyy6eAQjH9EaD56 y+TKNF/gJtDfTMWaYfGrODYTZrOfj1Q67aF/rJQfbYCktUoGYL0Z2f3v++nE7ljqjvCD 4wpZe8Q0xbBw2PL8roxi7e/+1xj/nLp+N8a85kuwDC72avAUQj2lvBwR+bMAVOPTQnp4 lq66oHzB6h9IGTiSJ57+CfzDOrgIvvbF/xxGpetlZu1ZCbiCjV1u/bd8R+02X2yJek6g QmIw== X-Gm-Message-State: APjAAAUskuYXPrxGtKti8v2ySjV6vyfXu3o5CQuGZhX9Jc9q57OOX7Nf A6oCPc7CgBkH5LUBCUjGN1tJMw5R X-Google-Smtp-Source: APXvYqxTNKW2CyiIMfANhKjiMwssjEIcuODS+s38UVtJfqUY0mg4DeBSiSMeZ1Uyn8ANfTy7eMKQDQ== X-Received: by 2002:a25:7902:: with SMTP id u2mr28611820ybc.169.1580917223134; Wed, 05 Feb 2020 07:40:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:22 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 14/15] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs Date: Wed, 5 Feb 2020 10:39:59 -0500 Message-Id: <20200205154000.536145-15-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 rings. Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 ++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 82d30bae2ba0..a7e6b5de2c62 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1218,7 +1218,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL, int amdgpu_debugfs_init(struct amdgpu_device *adev) { - int r; + int r, i; adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600, @@ -1266,12 +1266,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n"); } + for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { + struct amdgpu_ring *ring = adev->rings[i]; + + if (!ring) + continue; + + if (amdgpu_debugfs_ring_init(adev, ring)) { + DRM_ERROR("Failed to register debugfs file for rings !\n"); + } + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } void amdgpu_debugfs_fini(struct amdgpu_device *adev) { + int i; + + for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { + struct amdgpu_ring *ring = adev->rings[i]; + + if (!ring) + continue; + + amdgpu_debugfs_ring_fini(ring); + } amdgpu_ttm_debugfs_fini(adev); debugfs_remove(adev->debugfs_preempt); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index e5c83e164d82..539be138260e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -48,9 +48,6 @@ * wptr. The GPU then starts fetching commands and executes * them until the pointers are equal again. */ -static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, - struct amdgpu_ring *ring); -static void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring); /** * amdgpu_ring_alloc - allocate space on the ring buffer @@ -334,10 +331,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, for (i = 0; i < DRM_SCHED_PRIORITY_MAX; ++i) atomic_set(&ring->num_jobs[i], 0); - if (amdgpu_debugfs_ring_init(adev, ring)) { - DRM_ERROR("Failed to register debugfs file for rings !\n"); - } - return 0; } @@ -367,8 +360,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring) &ring->gpu_addr, (void **)&ring->ring); - amdgpu_debugfs_ring_fini(ring); - dma_fence_put(ring->vmid_wait); ring->vmid_wait = NULL; ring->me = 0; @@ -485,8 +476,8 @@ static const struct file_operations amdgpu_debugfs_ring_fops = { #endif -static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, - struct amdgpu_ring *ring) +int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, + struct amdgpu_ring *ring) { #if defined(CONFIG_DEBUG_FS) struct drm_minor *minor = adev->ddev->primary; @@ -507,7 +498,7 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, return 0; } -static void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring) +void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring) { #if defined(CONFIG_DEBUG_FS) debugfs_remove(ring->ent); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index 5134d0dd6dc2..0d098dafd23c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h @@ -329,4 +329,8 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, int amdgpu_ring_test_helper(struct amdgpu_ring *ring); +int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, + struct amdgpu_ring *ring); +void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring); + #endif From patchwork Wed Feb 5 15:40:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11366487 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 51965112B for ; Wed, 5 Feb 2020 15:40:48 +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 30E7720730 for ; Wed, 5 Feb 2020 15:40:48 +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="u1KoK+lK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30E7720730 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 640156F623; Wed, 5 Feb 2020 15:40:28 +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 A89966F61C; Wed, 5 Feb 2020 15:40:25 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id l22so2707417ywc.8; Wed, 05 Feb 2020 07:40:25 -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=qeLHl579ioTT6rY1/3+ixHutdDt00Chlwn731EBjwWM=; b=u1KoK+lKkNOUDR/HaNzle9Fq0sP8EgOVBTVgMifk8qHSXMTRvU8LYyDT3580zyYZpX VPiqsLKt7Uh7hPRSr1li7VVfLrk5cVmRNERYXeEkL/xjoFzHswVP6xojWt8gqUFbMGkl p/2Jz9zu75fUFiR+XCYcA4akt+KWLUszTTKPBapZ3BEbl6P5/LNThuf4q9kT5IMB6vjY H3y4561zRrCnEnZSDLE/N5I1xZ8SAFIdujp0fsh3ou3RkB/Aa0P5RkXyjAtXe8QpwRhO K1DHJOvrD6hd4BKwoeA9e98XekPdLyIktF7PheLCFG4x2Ld0IpYTw2yF663+yZN3lhL+ mTUA== 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=qeLHl579ioTT6rY1/3+ixHutdDt00Chlwn731EBjwWM=; b=GdtGsGA943gQDjGSdjwAiApxcxYDBMs20qeaxK1m2Hwjk8V1suaP3oDt+veOMPklFD JngNtSNsr2nU98ovKzG7RyQnzvSB8SXLZa4DxFdtJVVYQbNVQuAQBdmtVU2YtBdEqizh jb2eLOgBvNB+fMyyXAF+8eg232WteoeMt+7U5kR4Qky5gjQbk12EcBsVlyXxb3MNLm8z Q3XVrivK2E3KVMnFL7tyAN4MsjJnczsoOeiW52y3Ybv8bg45pb7rZyzWq1A0yKGHuF01 LO/zfLQ4VuZYctvayvTlxIW1UH+A6o2bQq8Yej5ZB/7zxO5UnZeVVMLx0Pve1qnpvbBu 2P9g== X-Gm-Message-State: APjAAAV/BAo85KgYTXE5fRzPnaFwoW559/Agi2tkyiFXyp3SPyyLEZ3v rs1OL5bbzfH8g61FqLloodwveTPa X-Google-Smtp-Source: APXvYqxJ0B0RBhzIAQVVrUojryZJ/msYWFHTq1iP30p50PNalOqmU8Tvz3sWWBHUrpD9zKFkfbMlMg== X-Received: by 2002:a81:4c42:: with SMTP id z63mr11258802ywa.24.1580917224497; Wed, 05 Feb 2020 07:40:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:40:24 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 15/15] drm/amdgpu: drop legacy drm load and unload callbacks Date: Wed, 5 Feb 2020 10:40:00 -0500 Message-Id: <20200205154000.536145-16-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" We've moved the debugfs handling into a centralized place so we can remove the legacy load an unload callbacks. Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 4dc7145368fc..12aab522f459 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_init(adev); - if (r) - DRM_ERROR("Creating debugfs files failed (%d).\n", r); - if ((amdgpu_testing & 1)) { if (adev->accel_working) amdgpu_test_moves(adev); @@ -3216,7 +3212,6 @@ void amdgpu_device_fini(struct amdgpu_device *adev) amdgpu_ucode_sysfs_fini(adev); if (IS_ENABLED(CONFIG_PERF_EVENTS)) amdgpu_pmu_fini(adev); - amdgpu_debugfs_fini(adev); if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10) amdgpu_discovery_fini(adev); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index f26532998781..9753c55b317d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -1031,6 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct drm_device *dev; + struct amdgpu_device *adev; unsigned long flags = ent->driver_data; int ret, retry = 0; bool supports_atomic = false; @@ -1100,6 +1101,8 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, dev); + amdgpu_driver_load_kms(dev, ent->driver_data); + retry_init: ret = drm_dev_register(dev, ent->driver_data); if (ret == -EAGAIN && ++retry <= 3) { @@ -1110,6 +1113,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, } else if (ret) goto err_pci; + adev = dev->dev_private; + ret = amdgpu_debugfs_init(adev); + if (ret) + DRM_ERROR("Creating debugfs files failed (%d).\n", ret); + return 0; err_pci: @@ -1123,6 +1131,7 @@ static void amdgpu_pci_remove(struct pci_dev *pdev) { struct drm_device *dev = pci_get_drvdata(pdev); + struct amdgpu_device *adev = dev->dev_private; #ifdef MODULE if (THIS_MODULE->state != MODULE_STATE_GOING) @@ -1130,6 +1139,8 @@ amdgpu_pci_remove(struct pci_dev *pdev) DRM_ERROR("Hotplug removal is not supported\n"); drm_dev_unplug(dev); drm_dev_put(dev); + amdgpu_debugfs_fini(adev); + amdgpu_driver_unload_kms(dev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); } @@ -1434,11 +1445,9 @@ static struct drm_driver kms_driver = { DRIVER_GEM | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE, - .load = amdgpu_driver_load_kms, .open = amdgpu_driver_open_kms, .postclose = amdgpu_driver_postclose_kms, .lastclose = amdgpu_driver_lastclose_kms, - .unload = amdgpu_driver_unload_kms, .get_vblank_counter = amdgpu_get_vblank_counter_kms, .enable_vblank = amdgpu_enable_vblank_kms, .disable_vblank = amdgpu_disable_vblank_kms,