From patchwork Fri Feb 7 19:50:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11371063 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 A9005109A for ; Fri, 7 Feb 2020 19:51:19 +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 8788B217BA for ; Fri, 7 Feb 2020 19:51:19 +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="XTHdaXyR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8788B217BA 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 3424A6FD69; Fri, 7 Feb 2020 19:51:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 458556FD62; Fri, 7 Feb 2020 19:51:08 +0000 (UTC) Received: by mail-qv1-xf44.google.com with SMTP id y2so161139qvu.13; Fri, 07 Feb 2020 11:51:08 -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=6tp8lbkNZ4vvovr7+zUqpsvLjCLpUqj6oN6SSSy5BNA=; b=XTHdaXyRMooLO9PCRIIvNA3nZpRTjJPokIgNRzV/Vr/k3yhVCfeAf/gI/3iJwkSp8Z SJCPMWz+RRfaTF9F7j8aWpHjB3SoAVCvatENdBwGyumQpSDdo4YEXr89OSgAFuPA2fv+ NTMSbkm2mahon0l0RoMr595iN4AQ0Mp0McPkAF9NX3+9/mmhccHKeki1tI+K+t9ifUlj aPMEZsTpqM8bswNElAgDIHmlbE/rjH0mc9mG8ZQExLZCUidw6bDSCylP+JgYBqf6XriT Ci/upospPyDB5J2C7tiRTbu5Oy3QocyS4nt7LywPSzGsPKYm9iwUdzSwqjyHuH58+J+L EXvw== 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=6tp8lbkNZ4vvovr7+zUqpsvLjCLpUqj6oN6SSSy5BNA=; b=l7xbpbnZf6+fyqg2dakn9ouagGzmf8HLcAaizsBjxo4INrXEIao/DWCJ9+7EvPJIEP s2b7CBtpB6JsSqYls6REQMASjdJTcsff7PPwuJ5Of5nm+EUH1KZCccdefh23ixKhjvTl +C7yHpOY9W0NLSxQm/MVL5ZOxS5uzzE5zo0YYrA4ZFBEC+HJG+B0tdq/Q0Z3x8YX2WfM NgVhgsowMLyssvwKiGX34rO4vtlfia1PdjcX8lQZa732JyImS/BTwEXmUjjEmBUCYcnS VxryAzQB5Gc23XZPIivZBZX6/d+GHME9j6qnoUOEEC5R0DFruaGmHEK6/MHAOg0lLXbT YsVA== X-Gm-Message-State: APjAAAWjtBg+Tw7vc6H3wRaGJ+3d2sv9rHd4j50r+g2qG7HGtnU0evh9 FJG4dNG1MYCr67JEbPyjBRz1j/r3 X-Google-Smtp-Source: APXvYqzq+Pf4rTp6584dAGIQmvuyHazMjhgHHqxhlpB4+yHq1tZwSGb36+eTiJoloEmBWVIkqZn5Hg== X-Received: by 2002:ad4:55e8:: with SMTP id bu8mr20149qvb.61.1581105067061; Fri, 07 Feb 2020 11:51:07 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51:06 -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: Fri, 7 Feb 2020 14:50:44 -0500 Message-Id: <20200207195058.2354-2-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 7cbb6d358ee1..4cf1c2d261ca 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3260,7 +3260,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 Fri Feb 7 19:50:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11371069 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 68F5714E3 for ; Fri, 7 Feb 2020 19:51:29 +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 4770921741 for ; Fri, 7 Feb 2020 19:51:29 +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="vaJUVCOi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4770921741 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 760866FD77; Fri, 7 Feb 2020 19:51:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by gabe.freedesktop.org (Postfix) with ESMTPS id 516876FD6B; Fri, 7 Feb 2020 19:51:09 +0000 (UTC) Received: by mail-qt1-x844.google.com with SMTP id w47so312352qtk.4; Fri, 07 Feb 2020 11:51:09 -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=IQTFjwgMEchTjLa3goNtnNye4mlWjyfx3vJFX1V23Ig=; b=vaJUVCOi5v0TRstikZiNpLyIp0J0TWcPezuaqN/KxCzIM7Ir9CG/TrQy+KelUXXCGP u4KJ1kXRGQrKtxfxF4H4IZApF04ocIGcMa97XiEf/ozxe2IFpRyd2JZY78ZVRvzrlaXq I+Mae8RQIQh7pCUJebu4AeDO955DRmW4oopXVuzRxpp8OW/1oPkes/sZYXjBaSneQY8v 3vfZRsIEmtvcsMJcVp5dJSsurl0fpjoDgDtfOg1A6FxeIYo7QxLZ0ycLZDxXtI0yGNkF QmWnNDk8DnfmgasMLRBrzObkdqFlaDolt/oKpqrS3OZzbSbPSuNgnnsqMwTPTulAIB6x fs7g== 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=IQTFjwgMEchTjLa3goNtnNye4mlWjyfx3vJFX1V23Ig=; b=HIgoWjosnVeb9a65W9CSN0NQx8Auw9jjSF5CaEGzrlIMY2mblK1TM+VHWRM1Pj7X3w 4Lv0GRvENNE+f/zlAF4wqhxMAYX915noWQQVjP6Zq12Hfpo0WIW53lnc1IMiYXZMRdRa pBeSi9oV1mcG3HiTvnqS6mjH8XsKtks5+cxUqTnTntpHNqE9E9nqmR5+aCIpgIQSeFlU /aix1dl9mPklr2q+HBONXRWS/O4/CUTI8cQu0xINyJtEcIDpIleYv1tsFzvk+J4hwFFn Z+0Y0TTK1Hq+xTGuzzqlo7rs8uYIJfCJVkz1k9wVUeWLXq13wqRgYxaIYha4KRb5bHbU /7Ow== X-Gm-Message-State: APjAAAVWPHbKMgZZ09kBa+2ZFM8rLBnNYFg2GezUbewwH+WngXZJzYf3 gVtj9Zs6r68aaoHLVKY41KDaP2tr X-Google-Smtp-Source: APXvYqxx7Fpnk1NwLQzdVBi75uNBt8CBi4/gTdvBmSoGbVklIICWD8vH/QCumpZlnUZOF1EUGRwzMg== X-Received: by 2002:ac8:718e:: with SMTP id w14mr11143qto.266.1581105068074; Fri, 07 Feb 2020 11:51:08 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51:07 -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: Fri, 7 Feb 2020 14:50:45 -0500 Message-Id: <20200207195058.2354-3-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for 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 76f86d64dd35..15f5451d312d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -68,9 +68,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; @@ -1921,12 +1918,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; } @@ -1948,7 +1939,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); @@ -2548,7 +2538,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; @@ -2584,7 +2574,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 Fri Feb 7 19:50: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: 11371067 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 039B314E3 for ; Fri, 7 Feb 2020 19:51: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 D682A217BA for ; Fri, 7 Feb 2020 19:51:26 +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="SZsee5xp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D682A217BA 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 038236FD72; Fri, 7 Feb 2020 19:51:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by gabe.freedesktop.org (Postfix) with ESMTPS id 15D0A6FD71; Fri, 7 Feb 2020 19:51:10 +0000 (UTC) Received: by mail-qk1-x742.google.com with SMTP id j20so252154qka.10; Fri, 07 Feb 2020 11:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=th/ZgWYLAtD7x9QpC0cnoR2MFKa3NkheKEaS9VVgMWk=; b=SZsee5xpM7I5CdhIUV/YI45kivS0/aXXyqCCL74EbQomIbPSTtzBHw00wR272IN+JE zjUaTXiBTjJsq23+WrCiE+szAmsiM3g0VvDHCUXNiuHiklF5Gams7Af+7dQ2S8OAk97G RVjgRocD0B7qkgtXVty2Lszq1Yc2x4uWj57vjLgbRIlKrIQVQC0p+pWb9rIvS7uA1Dvh ZckhO2fe0UVZsKXSdc+jUg0O0SX6Tc+5PquBE4Dqxl2soapaZ39ACBkKZpeoS70X1+9d TQI6e2r6glamJJggcBIo3gflaXL8SqiPmn7kgRe5BEnUSQk6SWKzSFNMBfr7Yo1eQJ9B wdgA== 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=AHSswcQwv7Wlvt9ieECup2oCeIgbdJhxbJTETHtAyLYoZ33LsLJHli4fVxNLD+jRSH eS/sxVmxk+FB+qWdvWaf0bR2qsaPXej9Wsz/rlRR9KiuaXp3Uld1u7055F33DFZWbuE1 xeRff3DoHC89bIBLuWK/2dMquYqKeSmaXwpRNruW3hVKHz1n8TQP1swn2jWNtNXSFZOc i7KCfjw9kT6QmQs5cVg7klsWP9Wj+Xru4j0Ka5Nik7h1+unJKUfINmprXkbpf/6cfJ85 3qWKLEF/Xm6cB2pGMMYu7sKfy53OMKnW4DoITHRkcau+8ski9e7JcvQfOqglvxi9bgg8 Z97w== X-Gm-Message-State: APjAAAUXQKXy84nD2Wpi3XwnjrL83YzMzjI+EuNs/lz84tCWILp243wt KVBHbgmrABZEATw1W8aezgN0grJ3 X-Google-Smtp-Source: APXvYqyS0ij02u9eMv56it9KwAIFxSxFFiVKtZ+PoaKJhr1fohJeLnIhy9UtXAB0U0RWMbH8USqZow== X-Received: by 2002:a37:4d85:: with SMTP id a127mr504632qkb.267.1581105068953; Fri, 07 Feb 2020 11:51:08 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51:08 -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: Fri, 7 Feb 2020 14:50:46 -0500 Message-Id: <20200207195058.2354-4-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for 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 Fri Feb 7 19:50:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11371065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8A57109A for ; Fri, 7 Feb 2020 19:51:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7034222C2 for ; Fri, 7 Feb 2020 19:51:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y8tbKX9V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7034222C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9373C6FD6F; Fri, 7 Feb 2020 19:51:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5A736FD6C; Fri, 7 Feb 2020 19:51:10 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id w8so273951qts.11; Fri, 07 Feb 2020 11:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O1jdP4CEORovm2VR+Fw+/VJ73Y3rqRpk3hpguLeOylg=; b=Y8tbKX9V0bsUrlHlP5JVNVW4khKM/2I1ukPFr1qJTFP01ucuoOz8FPxAMmVyV5Vl7S FYA31LEMS4V4nayk+YiIAKVnHN7p9U2ocUgFXSM7rq33DD3jJ4Um9vawMDktu5KcKbb7 wqvzZ0Q51ue2Y0apuroXUOr4g6NJ4xwQDt9qNNlJn0AuyVyLv9IOVixHw2v/agW6qhOO W1X4qTvF+NbWhgyIStjxLQlXKWmnHXYmnfRhzEo7RL5Pvh4bFe/nbJkWjaAhcGWPvtku AMKQDyt/J5z6PU36ONL0f+udCR/xUGi8jrkggS00Di8E4TJNScbMmS9ZU7jQqsRlQUfy xOCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O1jdP4CEORovm2VR+Fw+/VJ73Y3rqRpk3hpguLeOylg=; b=eaigP/TPcbGTaLNh3E3CFcC0CpKjOfHA57SkG75cGOgLA4quoHCYu4ptjvIFQSJItH GzudxdeBFbiXL5WC8hBCoRqLjY9fBonMaJh9SIskPqbsR6+nZ1kEIn+afHriqT4SDdgB C5sh+WmTiihkAh8I/18nrHCB3cx+2jzvs7I56TWL+uH9IafCiByl/4C11cfR+Bfr++Pz wZ4VXbSFTSI7jRZXaVgWl0oG1MSK2g9yQczLeEza+DrU04kmjDtLQZzhAupsecGyTEfH nrCv9ATQnbSyJxpnlWyLrnFTT6gtOsl20em4EVL7fAdUmaxQZ5O+WFVZthTrDU0t4rmJ H92A== X-Gm-Message-State: APjAAAW1nfLTCGM2IXKkmkpluqw0mIF7aAitObTNl16u8JbhG2ND9uzI q7GzO39rqxdayiynwqztTe8ZbGqm X-Google-Smtp-Source: APXvYqw57GQhOzatx6DLONDFO41YN9OoHqT2jEg9qJZ1NdjhVGvY+eq793wdQ9XcplLR3o6nsiWsrQ== X-Received: by 2002:ac8:5215:: with SMTP id r21mr471203qtn.77.1581105069809; Fri, 07 Feb 2020 11:51:09 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51:09 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 04/15] drm/amdgpu/sa: move debugfs init into core amdgpu debugfs Date: Fri, 7 Feb 2020 14:50:47 -0500 Message-Id: <20200207195058.2354-5-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for SA (sub allocator). Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 ++----- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index c1d66cc6e6d8..84c5e9f23c76 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1241,6 +1241,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) return r; } + if (amdgpu_debugfs_sa_init(adev)) { + dev_err(adev->dev, "failed to register debugfs file for SA\n"); + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 6e0f97afb030..abf286f2bc5e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -48,7 +48,6 @@ * produce command buffers which are send to the kernel and * put in IBs for execution by the requested ring. */ -static int amdgpu_debugfs_sa_init(struct amdgpu_device *adev); /** * amdgpu_ib_get - request an IB (Indirect Buffer) @@ -295,9 +294,7 @@ int amdgpu_ib_pool_init(struct amdgpu_device *adev) } adev->ib_pool_ready = true; - if (amdgpu_debugfs_sa_init(adev)) { - dev_err(adev->dev, "failed to register debugfs file for SA\n"); - } + return 0; } @@ -421,7 +418,7 @@ static const struct drm_info_list amdgpu_debugfs_sa_list[] = { #endif -static int amdgpu_debugfs_sa_init(struct amdgpu_device *adev) +int amdgpu_debugfs_sa_init(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_sa_list, 1); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index 26a654cbd530..7d41f7b9a340 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -330,6 +330,7 @@ void amdgpu_sa_bo_free(struct amdgpu_device *adev, void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager, struct seq_file *m); #endif +int amdgpu_debugfs_sa_init(struct amdgpu_device *adev); bool amdgpu_bo_support_uswc(u64 bo_flags); From patchwork Fri Feb 7 19:50: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: 11371071 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 85CE3109A for ; Fri, 7 Feb 2020 19:51: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 6487C21741 for ; Fri, 7 Feb 2020 19:51: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="tiIDrcsL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6487C21741 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 987326FD78; Fri, 7 Feb 2020 19:51:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by gabe.freedesktop.org (Postfix) with ESMTPS id B4C4F6FD71; Fri, 7 Feb 2020 19:51:11 +0000 (UTC) Received: by mail-qk1-x744.google.com with SMTP id j20so252254qka.10; Fri, 07 Feb 2020 11:51:11 -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=tiIDrcsLW836k++hg9Aw0QrmZf71n1Zhzv0MOCFnmL++agdzWXgdl7+5zUe5wdyyhD lw+fo9oQTc+Nrf2X812Mg0a2B7UBcE8UmJcY/NKFKudrG+zr4PuZ3/fvgFf+MzYQmJEw EGCKoTZVwt2e2Mgr0KkGbSfAYHItyFCUwJ9Gf1+YtyGgDXhdgGtacBZD+exjCg6SeE+5 6BpwgoyRmSkf2q+zShOU5mc36mdOtL2H9NkhvAAB7O3HSj5qJ4XDGbHwsx+ACfK/vSAy VCa0Ir5m+pcF5yw+VsE5TcEOJSBgm24z3A03DG65lWM/0eoneKk3DzPX+cKmwqRKL9Xi iGJQ== 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=uTzTYbOeEJxHdPDoOFJYYkN8cyjSVGI1M3kTtyjdEYik3Uh2+hbos8/kTRuCfv+H7a u5tobQkJEjir3vKDa3cgdyXad4nZP3EyqCF/XNfLEk1Ehfp1i0sEm8WJfqrxS7hWjsJM F52GFbagIb9yguHhX7hnoIADsJuCGMTdTgk0KqggUtRe+2NwSuwEpvRSjhcEhfRKJpIx hrl4r2NRS3YGImygOKdVzVbDWxgLaWYIlJa7Sw0P9qdf3ID60Mcb4U/vle3nqRqfzpBW im/DU6I/YkgsR8Y9dUE3/uDx8CSvpZP6uqEFY2jjRdAdxBlFyaJP4jsPHcm/6xEJ0Pru VRvQ== X-Gm-Message-State: APjAAAXuIn+gUKo4ea+5XYsEBJD2jAsCESkf9thOx+rhpryZKV+asFwI ABXp3PHeFVGkO3lBOYQ5VN5aWm6M X-Google-Smtp-Source: APXvYqwcvKM4XqtLBNpp1gzixUU4c2qPVCAd3yaUUGdKvtZHXadujAcMp+7Ge8EGMAKQw2ZO2Vh3Cg== X-Received: by 2002:a37:6346:: with SMTP id x67mr526597qkb.476.1581105070703; Fri, 07 Feb 2020 11:51:10 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 05/15] drm/amdgpu/fence: move debugfs init into core amdgpu debugfs Date: Fri, 7 Feb 2020 14:50:48 -0500 Message-Id: <20200207195058.2354-6-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for 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 Fri Feb 7 19:50: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: 11371073 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 EBB2C14E3 for ; Fri, 7 Feb 2020 19:51:32 +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 CA3CF21741 for ; Fri, 7 Feb 2020 19:51:32 +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="fIgBncpd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA3CF21741 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 C4DCB6FD76; Fri, 7 Feb 2020 19:51:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by gabe.freedesktop.org (Postfix) with ESMTPS id C28F16FD75; Fri, 7 Feb 2020 19:51:12 +0000 (UTC) Received: by mail-qk1-x741.google.com with SMTP id w15so276212qkf.6; Fri, 07 Feb 2020 11:51: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=RTgGxHJYBOc/AOgPlCZnYLG4WwQuIWgZuky2QefgHXM=; b=fIgBncpd/OPPojmADp1OV754fLf7jJ0s1QanZbRmAuu/0VvFTvanKG5qb2ceIkfYZU FIMudKzzqe0Kz+U8BTId8uk+5jUUS7ifM2rsIIWjGpxMdLg+8uucgDc6SgOyt46q1O7a q5bnfUyxcm6DDbIzhif/YtN1sk1XRcBoGZkvYb2Wl9FeTmHbBaJff0QKOQWPGIsaavmc v/hcGeaqPV/M5ZRoZuNlASZlevoo+ZXe4XKaxOL9I23BxEW5Pt28SJoaUH/q+hFmEYAC s0jWEUBh6v1n020pscoAYjK6zxyghILV4GREFBERgj4EWbcyHVvRZyboof//mM1erCZT VeRw== 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=RTgGxHJYBOc/AOgPlCZnYLG4WwQuIWgZuky2QefgHXM=; b=kc1bKR8a5jdPClVgAXUhd9D8n9pXcL+D4c/WO2OPFPxbrma8Hb2Q9e/bpGFNTfkVwN f7qbjuHEzyi47UwVZDre3F0gldO1VPAuACOUoYDrbwOaU1E8emRVvAX6N7z0nhn3ZbWu fsbYM1xRHtYWUqftWtv0PHDwsxvUTKUdlpl5APJnyIXOhDUNPqHhIc2v1Z1EWJhBp7m/ l9dX8sJtEGg/+G7GPknm6+VhPnkUzo0cxXMwL/wu0PMKNk8N4nqalU3s2QkfySYk3aBO FNu/Z8wnD6sE3wVBrsB/uY0eUN++TrXoAqHUhVSETpAhSeQicqjiNSYesq5yDgQVdSAx M00A== X-Gm-Message-State: APjAAAV1+Bj5CQlyEEl1IohkvfJSuFC7opC6y7rcJcbG25qeqKx3BxAR FEDIAoCEG0q5bM9rAbIHTTT4e7nr X-Google-Smtp-Source: APXvYqxVcMCN91YjzTL599Ra8FC+0E/iX7x6BghuNsshK2pDul9koX12PWb11wAsavWyq/1zHoiFKg== X-Received: by 2002:ae9:f302:: with SMTP id p2mr530563qkg.382.1581105071662; Fri, 07 Feb 2020 11:51:11 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 06/15] drm/amdgpu/gem: move debugfs init into core amdgpu debugfs Date: Fri, 7 Feb 2020 14:50:49 -0500 Message-Id: <20200207195058.2354-7-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for 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 4cf1c2d261ca..c787aebc240b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3123,10 +3123,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 Fri Feb 7 19:50: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: 11371075 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 1F5F114E3 for ; Fri, 7 Feb 2020 19:51:35 +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 F188E21741 for ; Fri, 7 Feb 2020 19:51: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="X7dB9+wf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F188E21741 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 E453E6FD7A; Fri, 7 Feb 2020 19:51:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98EBB6FD79; Fri, 7 Feb 2020 19:51:13 +0000 (UTC) Received: by mail-qt1-x844.google.com with SMTP id c5so302945qtj.6; Fri, 07 Feb 2020 11:51: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=zc8VUEzmS2dq9xbEMAR/0o9h5zNfSg0c9LVevXQTLAY=; b=X7dB9+wfz208ZU1hKc8hEDnQ2XiWbRFTjHqMgvXtpBOZEtmwsmMCQcqoWAPlhDc96y DOf7t/CMXmvZ2WlW1IP6BoOHOGadrh1Fbt5N++qJci1jMpamrLggVyctsoFP7quUX6h0 vVX03z/DN1HHFNmMlddY3RtbHeMK/6jPrCg3HX3mea4n3HEGtx7+ZRAJpoTds1tC7yUw 3RTnf9ikiK0DZaj+XDHlg7i6OP0962HWGkfdIr3GrE8VHUA6FNondZxe//eoXxkrZxvN QVQgdV2P2MGYfwtgqLWwLzIGVpp3ou0rPIAG+JKWWM4dDg/bRw+VzZUUGBnZhdo16s8V TTYQ== 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=zc8VUEzmS2dq9xbEMAR/0o9h5zNfSg0c9LVevXQTLAY=; b=rTFWnafcosI1xUsLWv2xu1c7Jfl3c8h2hsTp6DcJPdklFJLWg4gK5yepz1jXwXGa+d NaLc+6GQuuCvaSrZPRaL83UqQewpvEhbz6zvYu/pkEgOSZHVlg9vmo3k6/4FrB22LCke kC4CkVV0A5AHSo7Y7CMUaI3Jt4yQx9U+Dg+7Xxqcr241aeAbF+EZa7tEdt35Tq96a+BP dBXNrWDO7aNb26/Gj4GNOKPTyEYkuRNL1473DPrznZqMck6v6tLxOKqiLkz+EaDf+LwY ljEXYST6mFzbr+3oRWRUgf9eQX6dqAsCDOCyxXCy+ajjTJWhBoaAFlncz2DQ7Jw1LI1j GdWw== X-Gm-Message-State: APjAAAXF0HmvunT+ES/vZvB1wTfiSb0QHMEKwQIImrxhd0OthraEF25W 65syrdKIVz0XlmaI6hq4+1W7M2xl X-Google-Smtp-Source: APXvYqysQB8uSWghFMLXtmL5WXltjrRiGIi1I3uR0Tx+RCOsCt4ZCYP0KbcEUjSAr/qbnDTsqj6gSQ== X-Received: by 2002:ac8:1a8c:: with SMTP id x12mr461597qtj.297.1581105072581; Fri, 07 Feb 2020 11:51:12 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 07/15] drm/amdgpu/regs: move debugfs init into core amdgpu debugfs Date: Fri, 7 Feb 2020 14:50:50 -0500 Message-Id: <20200207195058.2354-8-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for 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 c787aebc240b..3ec95c11e748 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3123,10 +3123,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 Fri Feb 7 19:50: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: 11371077 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 B3104109A for ; Fri, 7 Feb 2020 19:51: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 91B1321741 for ; Fri, 7 Feb 2020 19:51:36 +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="nP4jpFrn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91B1321741 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 2E51A6FD7E; Fri, 7 Feb 2020 19:51:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C3A86FD76; Fri, 7 Feb 2020 19:51:14 +0000 (UTC) Received: by mail-qk1-x743.google.com with SMTP id w25so295375qki.3; Fri, 07 Feb 2020 11:51: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=2qKi2lMG7T9Nkk9ZgGR9r/+oG5C3/NSCAfrSVeq2qn4=; b=nP4jpFrna4hHdMCSIT0uPqpJcp6KJfk/DccXLChd1AfhNYT1PfS/yLGFIVNTNO5Dbe dT1mhSBV1WCFIsjnNvcvQQm8s0Pnd3If4xZJDSQi/p3mXP8hos6tByqSqfOOUqJc68jq IZqpSJmuOKYe/fiiUX5osygb+s0FXZM6iu4LK/xyDqEWxhpAooQQ4WuYYjasOvAIz11r /f0VSfZFC+exDpbEp9+VcQ3oGs37OWKbXy/md67KV5FlU8M8lWGcErfIYfWXbweOupna 0GtECSxWuTLel/4YXcC1heUNrTNhWk2z3iwGKuFUI42V9Kn1IeAMNT5WRYue8M1VGM4K Lwag== 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=2qKi2lMG7T9Nkk9ZgGR9r/+oG5C3/NSCAfrSVeq2qn4=; b=dQLacq//ivqieSRkBg/7jGWOCxbPajuFOSwuY8EkxROA6hnZ1BcP7MmywMtsTmhS14 fr9veGEuOZ2U9doPJfeWIVl8cf7YTUWIijJvTI8cvFE9sFT8+HVBGajO6imbY/pHxy7+ aaZtWUMedDBw3bhQ9QQdBJABUXQGrn4AHijcCJD586SfkZ5/8RBDUVcOEQ0NCBDFaM6Z bRm5GPMqeCXPObkWK4R5tUiGTF+g4F06Pyub822L7VMorQlIvrhKSSjr7RmAhiiUDmlh pjcsjBZ8qplkK79GXVWmB5sg7jV4LrxBVQl6ESw/dCxpzyICLfWcLyq1jlRvK8RY7qXN GyKg== X-Gm-Message-State: APjAAAV61Bbu7iXsT4R7kQOPv7jRcSaIxa7uAiDNfHUh2MUvlHtldSmW 3JRCEJHh92UqA31/8ECumWQH4gSp X-Google-Smtp-Source: APXvYqx43FPgLz7YLKSXUzgdqrHaIklpE7bqFk4ve1VwIs4rirwY+slOnoW7EnasL9Wlr663gHMopA== X-Received: by 2002:a37:a915:: with SMTP id s21mr545009qke.112.1581105073417; Fri, 07 Feb 2020 11:51:13 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 08/15] drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs Date: Fri, 7 Feb 2020 14:50:51 -0500 Message-Id: <20200207195058.2354-9-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for 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 3ec95c11e748..5adf936cf733 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3123,10 +3123,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 Fri Feb 7 19:50: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: 11371079 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 A1FF6109A for ; Fri, 7 Feb 2020 19:51: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 80C3C21741 for ; Fri, 7 Feb 2020 19:51: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="gcvGazhI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80C3C21741 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 9B5F26FD84; Fri, 7 Feb 2020 19:51:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F3E86FD7F; Fri, 7 Feb 2020 19:51:15 +0000 (UTC) Received: by mail-qt1-x843.google.com with SMTP id d9so270015qte.12; Fri, 07 Feb 2020 11:51: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=a/BMDiqhoEnI0+MK5kOQbygtLUupSGYKuie/3X93O2U=; b=gcvGazhIJHtvRAG65KH84s2DnIP+lIBKG2rmRvuJMwYbcPFNLqXTB7jxQvJhETtjna kbWbwFguMI5JLL2XzJGSMvfTjJixJrBKNy65rO1w4jIfTPcC5hLnQ4xQRSH01sXhJOnL gECpYe69qXq82M/feRnKHBhmtuM0fx198JWoPSA4dZLPO3mQy+l3qKuqOcT4uCUybDRh iT1MMRS2TPa67ERcuju4wh1ZHBD8gVylrEtv6crlpCLLACHj7H/R/SB/QGlY7oKgEw8i /gugSqcElvYIylVESqvwCShvKoQ57qEv76McJhntlfkPdfHvcw6aG3mVIjKD7JPHxAzj rm4w== 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=eiF3iSvr4LyAAEFM/ka1AMgrvlJa7946z3dT/NIwb2PCG9mL6b36p+RACf84BD/rLR F3kS+d7OgsHC4Nsojfec32gvZbRPSPudl4qbuHqXCDfMPH8mSfpRoFL1LtjHSgYpw2H7 O/u/nSq7PuOkCQx/mInMC+9rSFmttKAM+CzppkYralGP0JHAHcwRSnYpDiJhOlyyZu2R KEmLRJQ/9mgF97FNLxcQzbnymmC3zJMFEJRCYO7uGcx7pLe3YAlXKCjciMlp+zlkm06S nAMz0+FoTCDg6poly5BhZ+rff2vtQ0Df9NbXSM9dbyrtqRC/0Ld5Jgm2Icgeqhjma2T8 +T6Q== X-Gm-Message-State: APjAAAXvlKofoetWwRCic0/GNPHL7i0NGF5chu+Zcai+zKy/K6smKNF8 BkHzR7qunWlZR8O4N7ABkuFSGfka X-Google-Smtp-Source: APXvYqx4lNwPhHjvDgbyj0a1AEG6sY5YOl5VqwwYKHkRePM2oddWriRhDYWdB1p9Y4ImixWRE1B4yg== X-Received: by 2002:ac8:1e08:: with SMTP id n8mr462183qtl.175.1581105074423; Fri, 07 Feb 2020 11:51:14 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 09/15] drm/amdgpu: don't call drm_connector_register for non-MST ports Date: Fri, 7 Feb 2020 14:50:52 -0500 Message-Id: <20200207195058.2354-10-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Fri Feb 7 19:50: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: 11371083 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 31F5714E3 for ; Fri, 7 Feb 2020 19:51: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 0FA04227BF for ; Fri, 7 Feb 2020 19:51: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="dp8ZO5B5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FA04227BF 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 690E86FD85; Fri, 7 Feb 2020 19:51:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by gabe.freedesktop.org (Postfix) with ESMTPS id B98706FD7D; Fri, 7 Feb 2020 19:51:16 +0000 (UTC) Received: by mail-qk1-x744.google.com with SMTP id q15so257551qke.9; Fri, 07 Feb 2020 11:51: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=xsYrQuNh+sVpWmRpiWGT+6wWdo77wFgu3ioKldiOfbA=; b=dp8ZO5B5jrUIODd3uGSh47Ky7pDD4uz53BtlJpxkmI9hlp3vn3T7LAvzpj/ww+Rz58 vqvsZe0xdokS0IWkiB4usXDp1/IurUCK/+McDXFJxlCUs+Pd2Nc8CWoIh+V0j3FtxFte NJAmtba+ZItC+c4PKc1b4lDQrb2hVnZcjSu8Ekdma3IIp68DeiR9lntftKXWmM2LGXdQ zZY+fWc3Wa+PR+dkcFF/mFzr4BwxYlNcScjQdPVbZqvOAmNOYEgfHhU+So2iB+5YFeK1 54A3rAJTthuvVCF8WHB6m/Ra4hVeV7TcHdixkXbYbu5Sbgnoh+lfWPI1XpBiPls3LV3q RG/g== 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=xsYrQuNh+sVpWmRpiWGT+6wWdo77wFgu3ioKldiOfbA=; b=q/+yn9dELB+agL9MHfwSn/+HlGpIYvwg8IXhL7FPeyfd4A0KczwenSdc2PNy6jwkt5 yyJzoTRhwe8rwbhcmM8YHffwZ7LlB0lXSO2FMU6rIe+hh9mQRuJ8LDdvZE9OU/kRnhQN eD3wRViY9K9s0oSJpe7LRHW+dX6Gl2k+BGCqYeYtY+F0MOCgj95LIWoKu+K4IVQMl6mY oc+tndU3m+86YGKeJ5xWHzPLAiczeBNLJb9CAJTOgOYnAn98tc2OEgXGkqokuJusPW5f zx0UspdEkuwyZmp/iwjfXN/zIzJudrUJgIKiwGap1crOgq5AYIi8NHMvLXdVCbGhen44 ZP5A== X-Gm-Message-State: APjAAAXKrdczO3p1qh2VFdkNnvHM5ch2G8Larb+/U3TCH/iBMTn4wfvQ oakKVahybIncBBhcass2df23ciWf X-Google-Smtp-Source: APXvYqyUHRb3UwFFbDyafl3y83rTQo56tMJSk3Fi+2DFonlCS9p6iyuZqOz2FmNWQaAG4eD+7pJTLQ== X-Received: by 2002:a05:620a:b04:: with SMTP id t4mr533002qkg.7.1581105075476; Fri, 07 Feb 2020 11:51:15 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 10/15] drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2) Date: Fri, 7 Feb 2020 14:50:53 -0500 Message-Id: <20200207195058.2354-11-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for display. v2: add config guard for DC Reviewed-by: Harry Wentland (v1) Acked-by: Christian König (v1) Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 8 ++++++++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ----- 2 files changed, 8 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..df3919ef886b 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,13 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (r) DRM_ERROR("registering firmware debugfs failed (%d).\n", r); +#if defined(CONFIG_DRM_AMD_DC) + if (amdgpu_device_has_dc_support(adev)) { + if (dtn_debugfs_init(adev)) + DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n"); + } +#endif + 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 Fri Feb 7 19:50: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: 11371081 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 25CC714E3 for ; Fri, 7 Feb 2020 19:51:40 +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 0463D21741 for ; Fri, 7 Feb 2020 19:51:40 +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="i9nkZr7J" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0463D21741 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 1670A6FD82; Fri, 7 Feb 2020 19:51:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBD496FD84; Fri, 7 Feb 2020 19:51:17 +0000 (UTC) Received: by mail-qk1-x744.google.com with SMTP id v195so243646qkb.11; Fri, 07 Feb 2020 11:51:17 -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=i9nkZr7JNT0yDJ9qBz6CtBu2TvvL4K9SZe9x9AWEozko5/EFPYMod9hhgZ/zewVycn cQiWpD0ZZ2B5TWyWaz9bElrAXRsKb1c5HDImzau3q5MPvqcmjMsF1cmDORNG78ugFDfT gQS6g1WVRfCNfKTqQGNJZ5OfhA9tzR2FqBwIwFufq54Z1ZQCsHcEXKaUOPj9YQyT/EVw 9HmyAuHczaY4KgZ9Eat8fQ0PixLLppKH9If/zLTGi+U/ga8EYbWdTXlJsV4bOr3zbsmW veYeUGCIFX/UJYkkHWaRGfd0KsUgK5PPGH8Hzob8q96FKpft56uQ6hivdrCUX1KxYfpe ZeFw== 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=kQufXCzuzzHsM1WAOLWbzOf2zQSuG//lyAJglZcB0aGMT3AhSEILoHkx0gSwPOOcVk dW2yjNRGrc0B1QzSlOk2pRXk0VPiMREDdTam5GRpMJr3NLNew9EJSyDP6mlJBYDU15Rx QYrPyQfv7sK8Z9e8bkxuobEHBXl+D1Lr6L+/FUpLjWdfrOSCff0awdYDT3+BdPNPucmx Sdr1tAdnRyyWzZEOEbDQHEPnVvCALToE0Xc+rNpblWxoLej+Aa4SyYjloNCpz9IieHxW qm336ggcwVtagXVO7ImkgHjkLmAxeEcgg/Rj45Zr4F1SUvMxVOikxAdrGx6/vayNx9ho XCcw== X-Gm-Message-State: APjAAAVSp4gYiuKmGclzhTqAuunEEze/AIE0Y0Zvd65RkxPAc87VecSU UAU8KIYgc9XxJSBbkXlBRB9DBKIb X-Google-Smtp-Source: APXvYqyBlA/KlB5rma84tYQhnbfHw6kb/y2LAkKW2RrCzJOX8BxXQKjI8F3D091GTCndZ5SDhjoiMw== X-Received: by 2002:a05:620a:49d:: with SMTP id 29mr551012qkr.178.1581105076876; Fri, 07 Feb 2020 11:51:16 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 11/15] drm/amd/display: move dpcd debugfs members setup Date: Fri, 7 Feb 2020 14:50:54 -0500 Message-Id: <20200207195058.2354-12-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Fri Feb 7 19:50: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: 11371085 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 153D8109A for ; Fri, 7 Feb 2020 19:51: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 E702421741 for ; Fri, 7 Feb 2020 19:51: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="ikMmYJwC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E702421741 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 78B726FD8C; Fri, 7 Feb 2020 19:51:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by gabe.freedesktop.org (Postfix) with ESMTPS id B690A6FD86; Fri, 7 Feb 2020 19:51:18 +0000 (UTC) Received: by mail-qk1-x744.google.com with SMTP id p10so116431qkk.5; Fri, 07 Feb 2020 11:51: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=L1GhNIx2PtGdglnqeJklgMjlbabviVksiURR6t7YZis=; b=ikMmYJwCTIkBMS9frwO3MRwmVg354wSQuIMZBYbBsyO69KipXIap8s7uUsADUrP6e0 +uT38HW+FWmEH39v6X5VHtzT0pD+GQbN/A4WThbNgSH09fXX2LeZd+QkVWWHbrqjeE94 FBQAjtQDVwdew1hJQGNWlOKeb2qUwhCoOn9iOpzsOETAoP+EIPbDje5oi/247GRXx2Yi SHZ6g5ALx7aO6jRnd0KyXhXZ8hUr0bJXnnHGYxs6huJ0D43+sjJlQpF6IYXsEQzRqxJb kM7+fks8GxnKy1QQ+p0CHMmQQ1rfp5P1+322NfbWrOJ9oFNXIbu7VEaoTuKbh7EcPj46 CN0g== 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=i6O83fyuW2j2gjBJMVOua6Xz3MO1vs9QUT+zl6ACDihZJmaYDwFsbV1DThEfSRZ71S 8AnvDMqIjk1TeT//bkhpWV8jc1KtyLOkd8+xaWx+LiqAxn7MbBPX/9t9ofiwiHPouyrL dxg3IjuzA90T+PfWj1qY6MlOVna6hF+JkRCSKpJjFbe7TUFFmn//XwOif5mdEpxwxlYc FUcKsETTpoL0s1RntRIqCjaqmLH9vaQOsJVqut/995n7/XSRjtSM+Z8zBAk3nZuXt2o6 bvHZghHNkWedh+KmR+27FE1V4S+DttA2YgzCnNYc4vdQrLfbkvPae4cK4kdmf6BhYfto S5hQ== X-Gm-Message-State: APjAAAXeI2nesTN5ixOShRK4PyR6iGqeaif5VmmWW4xs3qqRarw3P7Lt lWNAx64ZhTZipJIUP4YYzExjqS4T X-Google-Smtp-Source: APXvYqxpLke40XqSCzKCHk+JIyQEP/Z1BLV1P0iqX7n8HbJTNgrar/wMOmzS4rTEdnNfYMzYtn4aRA== X-Received: by 2002:a37:9bc6:: with SMTP id d189mr566083qke.44.1581105077709; Fri, 07 Feb 2020 11:51:17 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 12/15] drm/amdgpu/display: add a late register connector callback Date: Fri, 7 Feb 2020 14:50:55 -0500 Message-Id: <20200207195058.2354-13-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Fri Feb 7 19:50:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11371087 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 9991514E3 for ; Fri, 7 Feb 2020 19:51: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 7809321741 for ; Fri, 7 Feb 2020 19:51: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="ak+N9xwu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7809321741 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 BB0B96FD8D; Fri, 7 Feb 2020 19:51:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by gabe.freedesktop.org (Postfix) with ESMTPS id D35306FD82; Fri, 7 Feb 2020 19:51:19 +0000 (UTC) Received: by mail-qt1-x842.google.com with SMTP id w47so312795qtk.4; Fri, 07 Feb 2020 11:51: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=jSk8UNuSvV0yFKAsTmjIMgpIonbMj22btC08pBbXT2E=; b=ak+N9xwunflpk4Bp+gtPvBEOwDKiLji4HGoXoH8uMNeIINUr39B5NrV9BO9Ag0A4H0 WuHxEPy07gxQ+sC4jZTeRZOL6psg/bBHfjeesNtcr3tverv4fGEEyQvfz12rVhdrW2GW GVbeze/QRZOaQuEe2aL8PlaEQuQkve9FLyUoCH2jnbialnnj4v/7lBDP1RCPandnbkN/ mxgWS1B5q07VcJ5A4WitCkOguVooWlNNs0vvGuih6ujXlkIdBLjT9lNFdJFiQ5wPZ4fc WrSpwXO711oHGOgOhvyisVD2wSNrGzZh4YW8l/lDoXf6id1yhZtwb0hCYBcBd7I4cRr1 FwOQ== 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=jSk8UNuSvV0yFKAsTmjIMgpIonbMj22btC08pBbXT2E=; b=kR7CGV8G2YutNlWSBbs3qkTDqk7QB3zyK9FViconEPlE/e2N5WKPE4uOJXCOUHxIFk kTm2jTQGYzEhDyxKe41FzFAOY9oCbe7acKSh737gK2yBt64tiNyTn86hLo7rTaJwWF4C YpLuk058ftj5NmlefpynFuvL4j3ZbcHbWGWpRg7uFIU2ewuC23DnD+soGY4BOg/yJj4E cK8Kx3HiK4lskY1QAArWlhHgbKHZN9q2KyO1fYH5a4Erw9Y/2QeZdVWm2MfrezHR3AO+ ffOgoM7P3H5IOUC63OwKUu+Gb3t1vV5/5PSSHQftc3YzN3RhjidehSoLDRtAkWT7GX7u 3YtA== X-Gm-Message-State: APjAAAVDwwHU3c+1myNO8K7v7ibXmoa/x01L5+uLtsayLFMSf0g9sfz8 W/P1cTRrQmd9/1RTvqELLw3BDVMn X-Google-Smtp-Source: APXvYqzRSWTq4c2P0EYOdmbDCH7q0+o/PY8XzmKHxoojQ/oL+84kE+CT+kcsFF5PHAvDHAa2b+EFxg== X-Received: by 2002:ac8:1194:: with SMTP id d20mr445495qtj.243.1581105078717; Fri, 07 Feb 2020 11:51:18 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 13/15] drm/amdgpu/display: split dp connector registration (v2) Date: Fri, 7 Feb 2020 14:50:56 -0500 Message-Id: <20200207195058.2354-14-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher 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. v2: - add back accidently dropped has_aux setting - set dev in late_register Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 16 ++++++++++++++++ drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 10 ++-------- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 ++++++++--- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index ec1501e3a63a..f355d9a752d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -1461,6 +1461,20 @@ 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); + int r = 0; + + if (amdgpu_connector->ddc_bus->has_aux) { + amdgpu_connector->ddc_bus->aux.dev = amdgpu_connector->base.kdev; + r = drm_dp_aux_register(&amdgpu_connector->ddc_bus->aux); + } + + return r; +} + 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 +1489,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 +1500,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..9b74cfdba7b8 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); + amdgpu_connector->ddc_bus->has_aux = true; } /***** 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 Fri Feb 7 19:50: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: 11371089 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 BF2B714E3 for ; Fri, 7 Feb 2020 19:51:45 +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 9DF7621741 for ; Fri, 7 Feb 2020 19:51: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="M104C8OZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DF7621741 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 D654C6FD90; Fri, 7 Feb 2020 19:51:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by gabe.freedesktop.org (Postfix) with ESMTPS id A768E6FD8A; Fri, 7 Feb 2020 19:51:20 +0000 (UTC) Received: by mail-qk1-x744.google.com with SMTP id q15so257793qke.9; Fri, 07 Feb 2020 11:51: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=hpS9gOoEF48PiATu60PxiiASisTpI+MmTUv9TeQ4QWI=; b=M104C8OZ295ZzOJpwQhwBpeMd06KqjGjdIy+W74hEIMpl4WyvVcv/HWRNJ+4GwYKVI 8QbHKh4PLCywRA7FkdZwVeIql+7vAquPJCs+BvcgiFB9oU7cHm14I5HpV4BXIOfzc0Ia naB57tJkq5Fh8cr4llTaiGDUc5O+aOih7gDQDDRqNsS8D52NtF0A7Yj826SqLmqPqV+T 8ViAFOK6xl7+YO1a8f017KNJkS9GTToIM3onfM0n7MUGzKh42JiZvsR//k7J6wGZV/Yf PdZP38pK/HgPnTEieKbJjPWV9BtNTelXunpUq+arYhpd3cKeQjgICYsB7SYWlKZHqd1G lElQ== 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=hpS9gOoEF48PiATu60PxiiASisTpI+MmTUv9TeQ4QWI=; b=hdLab3p63SVP4FczI0Yo7xUhSLV4qEYw6gtyqwVqllaEp6n47F+GS8FpmfhlE8ljtf e4c1fNisC0CUGe9meIjFOL2J0mD3pw5g2S7IJueQI3s7uVP0XpmbaoSI7RbaHXT/1vp8 SDl6HY5GbkEQrb7Qro7NaXxqyxGSvakTg8MIBYfmV6c9CqdO6f3ZA5CuYp3I3duLAJF4 d4EW4/mKl9LjP0OSBtqk7+CFS3KfzvqJqFVwm6fqdbtmyEpRssA/BrGL38Koij7jG+j8 0mSwtuJUwQn14kW7G4deBOKELYkioiKPUgF7/vxmS5fP/7Pwe6A1AgRc4MgYDFeuOu5D ItLw== X-Gm-Message-State: APjAAAUfIDG8nkhMFkAQIpc4YghyosJxn8kmFVZ07G5yjziqCwifxkmV c5RrvYSQM+5xeAAPtNMkUrI4wryg X-Google-Smtp-Source: APXvYqyEnZfiXjKExC2Trp44cV9Dt/jfmCGKw6nCUH7LtC7x1CgxIwZacKTH8LPgWZswt2QymRh3xA== X-Received: by 2002:a37:6457:: with SMTP id y84mr550075qkb.254.1581105079582; Fri, 07 Feb 2020 11:51:19 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 14/15] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs Date: Fri, 7 Feb 2020 14:50:57 -0500 Message-Id: <20200207195058.2354-15-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for 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 df3919ef886b..7379910790c9 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, @@ -1268,12 +1268,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) } #endif + 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 Fri Feb 7 19:50:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11371091 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 E572E109A for ; Fri, 7 Feb 2020 19:51: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 C3FB521741 for ; Fri, 7 Feb 2020 19:51:46 +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="TVsmoM6K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3FB521741 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 74E776FD89; Fri, 7 Feb 2020 19:51:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by gabe.freedesktop.org (Postfix) with ESMTPS id 933626FD8D; Fri, 7 Feb 2020 19:51:21 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id d9so270226qte.12; Fri, 07 Feb 2020 11:51: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=V2e5/5/4Extm8IwF0Em+wLxlgLzS4i35oI6Snd77pz0=; b=TVsmoM6KIYQUebbV9yvb7AcvhDj0e4WxI+q3pKZo4xE1xDbmcoVLKyd9Mmfgm1XvZs hiTER+iorMRr+Hx8UPGqT9kdIma1Pu87OTr5KQraQcGqlqDpd3Hp7+cb/slWjEWpDJTR L6wE+PLeJ3hAxFVXafZSM3de4IPRw4yVMuQIC0X+RfNhTgRP4JdMQA0G5i7nQzsf+DEh vVPMj1vsKpzaNgACJjP1qn+u+2WzjmUEoWJhtBs7XNjwQ/5FzbszDelizozzfr4JTFjP Q4zNOyUgePWpUS7fmvnVNN3kLSDPs4kVwnBjCw5GijfynLGFEQJ/GsTaTs6VXnNGYfuZ FGWQ== 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=V2e5/5/4Extm8IwF0Em+wLxlgLzS4i35oI6Snd77pz0=; b=C4hX02IwQS/FQnwQYys6kPEqvj7kT1uEFeYwjcRALeGn7nYuMvUFF3syptEkaxanCP 6K42VkYtj/nbPsbtQYw0LkHZZsrX69+oP3HvtuCX20VWJNJfvgZ6xqogOaeVC3tkIIge i6Ylupdc7qM6bxzBBvu9IrLaWPngImgHg3rLHfDlpwWPHdmPthSNON5jmmhccMGgEhdM fZUyoVfAKSVnAqFsn7ddrkVwrMoOq6S258GNUBj6d+EOUYLiSLIy8/Likg1DBX/ax0qU 3nxF2zFOB/PA/MfrVST2To1aqgDFuf904bJHZ7/1WVkXpSMZ9ylg7Ko1GU4kdgeraYm9 Mpqw== X-Gm-Message-State: APjAAAXZHK9fcvaTZwFeSDv26ppCPuouyaNk9vygUH2Af4qw1E8ZxR2S XG23nkvwiNgWB27R+S+RwW+CweU5 X-Google-Smtp-Source: APXvYqwr1kxZ3NviN3Ty6CTAsSx3Lb91/d+9P5ah02qGSQZZa/AHFGZnG86Gkvzr5C7Ori46TdZZKw== X-Received: by 2002:ac8:7caf:: with SMTP id z15mr33784qtv.68.1581105080506; Fri, 07 Feb 2020 11:51:20 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id w16sm1752226qkj.135.2020.02.07.11.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 11:51: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 15/15] drm/amdgpu: drop legacy drm load and unload callbacks Date: Fri, 7 Feb 2020 14:50:58 -0500 Message-Id: <20200207195058.2354-16-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com> References: <20200207195058.2354-1-alexander.deucher@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 5adf936cf733..31e07d45eb1a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3123,10 +3123,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); @@ -3248,7 +3244,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 f0a82486a9b7..ff73af165e61 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); } @@ -1436,11 +1447,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,