From patchwork Wed Feb 5 03:48:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365735 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 69D12921 for ; Wed, 5 Feb 2020 03:49:14 +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 486FC2072B for ; Wed, 5 Feb 2020 03:49:14 +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="mli+pDrF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 486FC2072B 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 913076F454; Wed, 5 Feb 2020 03:49:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25E496F454; Wed, 5 Feb 2020 03:49:05 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id ay11so300964plb.0; Tue, 04 Feb 2020 19:49:05 -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=fS55egdy+8luMv5QIBYCbIZcNyl4rVr/C+KErPFDs/0=; b=mli+pDrFFtQ23/4PFrLlnMQN9uLRFtfiuvV8t94qKBD2PFa1dcGY3kjFtC+Akyaef/ ZgMr7r7Xu4D02Tzj3rlvpLQvBC05nlHwIzXycNDJZXj/d3Tv+AyeMDDNNqEaEqQ7dfql oCue0qEWFDy6GgZ0M1vFLeczbWwb/OTOKZEzXi+gc/jezlwYUoncZgoFbA++JfNoTxXt 5pvbwUONNvuY3sekwTHNaSeYGGOMqQVGL/nCo3VteEKJDlCVxHCtZCw3PRVViZ6ZsOPn EuMSC9r1mHs9eCgq9+PJdH9tZQWYXoS5NEaaFROPO/kCMfM9RfzlKCFGTMy9svmQl9rE rTrQ== 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=fS55egdy+8luMv5QIBYCbIZcNyl4rVr/C+KErPFDs/0=; b=bZzZcLY0jZk6xqPIatiP7Sh71aokh1F9pG0n0kgcODRHkEnmBCYt8+x2qirqwdu0ND OqjQvvKDRoc1BsA5fMQimssNgqOY84Y+fDuR3lKeRRfeuj1vDXzNcpYnIuEuX4zqpyq5 GwZofjTbJkt5hV8AO6Qf3I57OsrvKSU0znXYghZR1Kv0QKrIkILXa4synU2iSA5mTPKW 3PLqAb2ShP0PcP/BC0GkJYb5Fhhksqv4LaJMEmUY8EVbn956LtWlRWemNIlUipzEE/7Q p+67reMpSKFJnBIYTnk4B357GEMeVUVpt5652dlsz/xxcQ8Ep+z9kvL5uFFSoRnG0FAy Laeg== X-Gm-Message-State: APjAAAV0Ht7FjOaMOYa6GC8U7oSOomtAjVCUkha07uqmyTnEbGpIQsua 0pBeuW0YILIZ9ruaNNn/vVJnUaVS X-Google-Smtp-Source: APXvYqwhBoWhcQFAip8AJurREBLya0M1asGTneZKGJ7TZVrhQUIh9yu0oMsk22r9UuN1i8h9cQEbvg== X-Received: by 2002:a17:90a:332e:: with SMTP id m43mr3139218pjb.107.1580874544251; Tue, 04 Feb 2020 19:49:04 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49:03 -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/14] drm/amdgpu: rename amdgpu_debugfs_preempt_cleanup Date: Tue, 4 Feb 2020 22:48:39 -0500 Message-Id: <20200205034852.4157-2-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" to amdgpu_debugfs_fini. It will be used for other things in the future. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index f24ed9a1a3e5..58b5e1b4f814 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1229,7 +1229,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) ARRAY_SIZE(amdgpu_debugfs_list)); } -void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev) +void amdgpu_debugfs_fini(struct amdgpu_device *adev) { debugfs_remove(adev->debugfs_preempt); } @@ -1239,7 +1239,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) { return 0; } -void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev) { } +void amdgpu_debugfs_fini(struct amdgpu_device *adev) { } int amdgpu_debugfs_regs_init(struct amdgpu_device *adev) { return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h index f289d28ad6b2..b382527e359a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h @@ -34,7 +34,7 @@ struct amdgpu_debugfs { int amdgpu_debugfs_regs_init(struct amdgpu_device *adev); void amdgpu_debugfs_regs_cleanup(struct amdgpu_device *adev); int amdgpu_debugfs_init(struct amdgpu_device *adev); -void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev); +void amdgpu_debugfs_fini(struct amdgpu_device *adev); int amdgpu_debugfs_add_files(struct amdgpu_device *adev, const struct drm_info_list *files, unsigned nfiles); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 8df7727815cb..3b09897eb1e9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3228,7 +3228,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev) amdgpu_ucode_sysfs_fini(adev); if (IS_ENABLED(CONFIG_PERF_EVENTS)) amdgpu_pmu_fini(adev); - amdgpu_debugfs_preempt_cleanup(adev); + amdgpu_debugfs_fini(adev); if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10) amdgpu_discovery_fini(adev); } From patchwork Wed Feb 5 03:48:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365737 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 DF84E14B4 for ; Wed, 5 Feb 2020 03:49:17 +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 BE1A52072B for ; Wed, 5 Feb 2020 03:49:17 +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="iIPqAHtD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE1A52072B 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 98E4C6F458; Wed, 5 Feb 2020 03:49:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6CB4E6F458; Wed, 5 Feb 2020 03:49:06 +0000 (UTC) Received: by mail-pj1-x1043.google.com with SMTP id 12so361903pjb.5; Tue, 04 Feb 2020 19:49:06 -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=3+ovo0iYgzOlwPbufM9jSr3DhaQmmbwRK19EzNf16Io=; b=iIPqAHtDyIzxKr97V4uI6FMFq41mC55xeQg95oUT3hk4F/ufax5Ac6IFwBUQLHWb8L ODlD+CJ6217ZcUHtCc770y19pwfeusm37Vl0vlOfgt4RS4jQm1Yxo9FS3jyaCEMrgLhS 5pcdonl2mo1ewfwvz0growPxsgEXqwg5A0pXoV1w3xUaQ3pFlysEJ8sFCOSXLdE7Bqra HxIIUcQXVwj83WcI5QpwOQyeisXhS9Tyy5qsaStUPAsAKvGAXLV6QsRChBwONYXfr2zz vveazpQBAG6LtdTIEaabnvPyA/w9qrP0lCmGiLX5lCUtHb3uv3a85UwNDplG9ezNvXb9 W0KA== 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=3+ovo0iYgzOlwPbufM9jSr3DhaQmmbwRK19EzNf16Io=; b=ag/qbS7bZNbTTnftwPx0ea2gNKeeDdOJGfAmVD0owcPar6AjeHGWLHaUHFBkgMax7E cqRpHFIX/nE9QHx4HF96+jyiYtqceuvSaWxhsoOtECR9PpmqFpmQvsjsI4wyrceeIJWx lCpo+ynsA11aETgNEH3AwG7OP0g6pU+Mlf+t/Un2SW97JYRz13VtCOzKV6WLNS41sXPe I7jyptPDxWvRrydNJsCKnFPFVerL5xCY9nr6wkDcKoG5znfpBILQL5LXq/5Of1twqGXI A3nXh1e0J2AfKpojwPTdrg0dYsukg4oFrlpE1vzggPYnjBZSC5YKiv03ep85O0pXZS5n U5FA== X-Gm-Message-State: APjAAAWccD7UUOyxXzZUC4SctJEbem1/avVmftxIfBqckFhqpEIK6S8z 071Okxu4LiGr9EKBvV3ZD5y1fspq X-Google-Smtp-Source: APXvYqyZQ2gCLzdYODYGGT0mIOdV1JaLwvaQtPphffR0Hjrdlez3T/5gq/5IVUYcVL2ci3QuaMsLTQ== X-Received: by 2002:a17:902:b484:: with SMTP id y4mr32421152plr.126.1580874545723; Tue, 04 Feb 2020 19:49:05 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49:05 -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/14] drm/amdgpu/ttm: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:40 -0500 Message-Id: <20200205034852.4157-3-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 10 ++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 ++------------ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 3 +++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 58b5e1b4f814..f49604c0d0b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1216,6 +1216,8 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL, int amdgpu_debugfs_init(struct amdgpu_device *adev) { + int r; + adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600, adev->ddev->primary->debugfs_root, adev, @@ -1225,12 +1227,20 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) return -EIO; } + /* Register debugfs entries for amdgpu_ttm */ + r = amdgpu_ttm_debugfs_init(adev); + if (r) { + DRM_ERROR("Failed to init debugfs\n"); + return r; + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } void amdgpu_debugfs_fini(struct amdgpu_device *adev) { + amdgpu_ttm_debugfs_fini(adev); debugfs_remove(adev->debugfs_preempt); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 56f743698868..0c35978626d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -66,9 +66,6 @@ static int amdgpu_map_buffer(struct ttm_buffer_object *bo, struct amdgpu_ring *ring, uint64_t *addr); -static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev); -static void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev); - static int amdgpu_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags) { return 0; @@ -1911,12 +1908,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) return r; } - /* Register debugfs entries for amdgpu_ttm */ - r = amdgpu_ttm_debugfs_init(adev); - if (r) { - DRM_ERROR("Failed to init debugfs\n"); - return r; - } return 0; } @@ -1938,7 +1929,6 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev) if (!adev->mman.initialized) return; - amdgpu_ttm_debugfs_fini(adev); amdgpu_ttm_training_reserve_vram_fini(adev); /* return the IP Discovery TMR memory back to VRAM */ amdgpu_bo_free_kernel(&adev->discovery_memory, NULL, NULL); @@ -2545,7 +2535,7 @@ static const struct { #endif -static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev) +int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) unsigned count; @@ -2581,7 +2571,7 @@ static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev) #endif } -static void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev) +void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) unsigned i; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index f1ebd424510c..2c4ad5b589d0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -133,4 +133,7 @@ uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_mem_reg *mem); uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, struct ttm_mem_reg *mem); +int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev); +void amdgpu_ttm_debugfs_fini(struct amdgpu_device *adev); + #endif From patchwork Wed Feb 5 03:48:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365739 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 02E0014B4 for ; Wed, 5 Feb 2020 03:49:22 +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 D56C32072B for ; Wed, 5 Feb 2020 03:49:21 +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="F5X740cb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D56C32072B 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 F295F6F45A; Wed, 5 Feb 2020 03:49:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5A136F44F; Wed, 5 Feb 2020 03:49:07 +0000 (UTC) Received: by mail-pj1-x1043.google.com with SMTP id fa20so363910pjb.1; Tue, 04 Feb 2020 19:49:07 -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=1TDC92U8nuAvyygLVjc9oE1rL/0mGLYWnCBFIoGGCdc=; b=F5X740cbWbt3Jh3WXWZXGlEAzPDW7Tm/WDF/FryCntIUiD16+ruQhX4TBBDBmQHytE KpmaNNRjwngMm/2R0PWVG6CRYrCbS2NuCNhR9hxnqtxZrFCN6BGUV3WLuSSwtkrdLAUP Pc57GcfWKDRNI/ZlG0Z6Jbw3QiAlDznna1PfFpTg7mIInCCybt5dH4warZ5ef1Cq7lUp WEo/cZtJmC9LTo/gYQGz+kY+YqTuL/U2IMCw20ufx1dQXonYapi3r1/CFYQXoIq17mG7 lfoSiuCLTT83FSXK4rVJJwYlvcf64WwG5yPso6z15eR3Sc7tNyq2eTUpXpnVcHgfRFoW bCpw== 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=1TDC92U8nuAvyygLVjc9oE1rL/0mGLYWnCBFIoGGCdc=; b=AEA9qH8JQXssV1abI8xhYzqjNuFRg5PhNA11Rs1J2E8OrwZBf7vurQSBUdo+rGEOW+ Wd75J8f1qQDujQ8x4Hs1mL2cx5FusCcG5GEt9ILtUoKWF9igGLXFLNTlJB+/xXGmIBD6 /PaQU47ZKreHSJ7XWnW5l4PnSF0oHr4LIT+6h2OCb/epXJb9E5dlmdNUdOf7Fn4K7wW6 zFDfCux+bo06vQ1F8w++0EQQM2nq0AC+lRWtwwEkrlFMLIx89KZK99xZtXVTe/Iy71iQ 8bRytXvtrstrd34H7hZbBCfkhkirQJXD9YvifbYQ7Ww3CAIbUHpatx5GWy5qvI3AI7sI q9ig== X-Gm-Message-State: APjAAAUpJn3+vig2boYOaBhVGRF9ORszYW3ndt1LOQmGoi5Vxg+gDpc4 jGmvdCzwpUbZ7rerQx2T6CDUCha7 X-Google-Smtp-Source: APXvYqxcptPshSePK/jrShaTAIVb2kU4kV7jFS00rFK9MGneEl5ME1EjAKKIxA110dzLiGfJFyrtAQ== X-Received: by 2002:a17:90b:46cf:: with SMTP id jx15mr3300071pjb.2.1580874547151; Tue, 04 Feb 2020 19:49:07 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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 03/14] drm/amdgpu/pm: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:41 -0500 Message-Id: <20200205034852.4157-4-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +-------- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index f49604c0d0b8..c1d66cc6e6d8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -31,6 +31,7 @@ #include #include "amdgpu.h" +#include "amdgpu_pm.h" /** * amdgpu_debugfs_add_files - Add simple debugfs entries @@ -1234,6 +1235,12 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) return r; } + r = amdgpu_debugfs_pm_init(adev); + if (r) { + DRM_ERROR("Failed to register debugfs file for dpm!\n"); + return r; + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index b03b1eb7ba04..bc3cf04a1a94 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c @@ -41,8 +41,6 @@ #include "hwmgr.h" #define WIDTH_4K 3840 -static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev); - static const struct cg_flag_name clocks[] = { {AMD_CG_SUPPORT_GFX_MGCG, "Graphics Medium Grain Clock Gating"}, {AMD_CG_SUPPORT_GFX_MGLS, "Graphics Medium Grain memory Light Sleep"}, @@ -3398,11 +3396,6 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) DRM_ERROR("failed to create device file unique_id\n"); return ret; } - ret = amdgpu_debugfs_pm_init(adev); - if (ret) { - DRM_ERROR("Failed to register debugfs file for dpm!\n"); - return ret; - } if ((adev->asic_type >= CHIP_VEGA10) && !(adev->flags & AMD_IS_APU)) { @@ -3669,7 +3662,7 @@ static const struct drm_info_list amdgpu_pm_info_list[] = { }; #endif -static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev) +int amdgpu_debugfs_pm_init(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) return amdgpu_debugfs_add_files(adev, amdgpu_pm_info_list, ARRAY_SIZE(amdgpu_pm_info_list)); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h index 3da1da277805..5db0ef86e84c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h @@ -43,4 +43,6 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_jpeg(struct amdgpu_device *adev, bool enable); +int amdgpu_debugfs_pm_init(struct amdgpu_device *adev); + #endif From patchwork Wed Feb 5 03:48:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365741 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 723BB921 for ; Wed, 5 Feb 2020 03:49: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 50F092072B for ; Wed, 5 Feb 2020 03:49: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="fCkOn43C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50F092072B 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 B7A1A6F45C; Wed, 5 Feb 2020 03:49:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A5256F459; Wed, 5 Feb 2020 03:49:09 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id p14so463316pfn.4; Tue, 04 Feb 2020 19:49: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=vuEm2HIzfORxBaF7Sullv2s7r/FUJ9zIHEgHHa10pSk=; b=fCkOn43C99OoRB2Fhs9Z8ilknGM+fIe6rMXzNw8DfEVFMkw1jcWGmHUoACvGV7Oaf+ hwORpJBG4s6i+UraPxLWNK0vEn6V6qqoRoUlJlA9shwGcxPgTF8muADC8CxxH7RRWLvl PtKToLjEFSGw/ljwuJsgbb+anU5zEyctUnUVJ950DSULtxgyql6GRO6nMozm8UjMuIZE uqzsGNPYJSJKYvotbDpIr983rdWu6/dEekdBRMOK1TlrESFe94cpVA9/aJwT31w05VwF LROf1aKHSPbHm2cfvAabOvuYvY9HgVC0E+Xj5ycVeUGKZWB9dZ4bpp6foNzPWLB2JQMf tHUg== 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=vuEm2HIzfORxBaF7Sullv2s7r/FUJ9zIHEgHHa10pSk=; b=Vnqe3NDZ75JQ1nEp2ULMHzHVVkPPN38XJi67tPRJysGpRvosuvdD+uxdVfuRFIP/9P Cw3/fx/LWBekTdRKpXGsK7x2ksgPtDsGd7AKXEvR3o3z4uSco+d5KbSHHM7cp9I60GQi Ks7lHZkEB1uFBFzGHAIbfO1RJxB69H/TyxlgCytdGb0xR6QLCDpnjZu7mEWulQPoMIne dJuw4Uk7D6ZwmiHn0L5a2x8Mk3PjUOutNbyoJIi+B84ajMhQg/i/7Wani1d2NTF/uktY meIU/FthMPn7FtoToi3rDh/by4klstorBP0EkfsuJS9RrCJkB2zp+xKSJOlw6OHANwkj 9KHw== X-Gm-Message-State: APjAAAXAq7068mlXalYQVfQ6L9D6KV/puOL159h7gpv/yPsWGSE5bBcB EZ5nScVYhkab3ZAHONwEgt/HyHOD X-Google-Smtp-Source: APXvYqy/VATuePuQxvum9YXMQmTT2XOWOMI/0SNAyG+CmMip0GhLq1nYXoXce3eIMHTUh1PpQtOKmg== X-Received: by 2002:a63:cd43:: with SMTP id a3mr23758443pgj.247.1580874548555; Tue, 04 Feb 2020 19:49:08 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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 04/14] drm/amdgpu/sa: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:42 -0500 Message-Id: <20200205034852.4157-5-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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). Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 ++----- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index c1d66cc6e6d8..84c5e9f23c76 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1241,6 +1241,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) return r; } + if (amdgpu_debugfs_sa_init(adev)) { + dev_err(adev->dev, "failed to register debugfs file for SA\n"); + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 6e0f97afb030..abf286f2bc5e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -48,7 +48,6 @@ * produce command buffers which are send to the kernel and * put in IBs for execution by the requested ring. */ -static int amdgpu_debugfs_sa_init(struct amdgpu_device *adev); /** * amdgpu_ib_get - request an IB (Indirect Buffer) @@ -295,9 +294,7 @@ int amdgpu_ib_pool_init(struct amdgpu_device *adev) } adev->ib_pool_ready = true; - if (amdgpu_debugfs_sa_init(adev)) { - dev_err(adev->dev, "failed to register debugfs file for SA\n"); - } + return 0; } @@ -421,7 +418,7 @@ static const struct drm_info_list amdgpu_debugfs_sa_list[] = { #endif -static int amdgpu_debugfs_sa_init(struct amdgpu_device *adev) +int amdgpu_debugfs_sa_init(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_sa_list, 1); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index 26a654cbd530..7d41f7b9a340 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -330,6 +330,7 @@ void amdgpu_sa_bo_free(struct amdgpu_device *adev, void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager, struct seq_file *m); #endif +int amdgpu_debugfs_sa_init(struct amdgpu_device *adev); bool amdgpu_bo_support_uswc(u64 bo_flags); From patchwork Wed Feb 5 03:48:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365743 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 4AB1E921 for ; Wed, 5 Feb 2020 03:49:26 +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 292162072B for ; Wed, 5 Feb 2020 03:49: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="JQGPySPX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 292162072B 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 3C5856F45F; Wed, 5 Feb 2020 03:49:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id C56576F45C; Wed, 5 Feb 2020 03:49:10 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id ay11so301075plb.0; Tue, 04 Feb 2020 19:49: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=zLOwvReqmhDb2j0Rm4OFDu4DdL2tfH5E0Yyw2x2mEdo=; b=JQGPySPXJ0kjjawhmfQqgoQxVtlrY74Hs5PIl72EceUF2AvdO7gZKCjAW9QLf7cWcs GVqXP7HOkaWK0s0KD1jUyhqgfMbKi1KstKBeeg7Teg2AsvUrLfLoZRbPmIpdz1Av5Wv/ qTa9y/8BZD4jEEcASCxMAh4nYhfhBzUKPt+lTncUt+XxSPiiuiaHcf+QnUZgZl+4pB+8 ghcciy7VQbDdsm3s+iXHOdDJwOhDKx4u0amsFlo2Rg9ztnLEwikioJRPd0wI4Ez3nvJj SkBZlAsodSMgzJC+ibzzFjH2kOV54YCcvMNpuh5hovUAPYlBjiC0G2eAXUuPiwKjH8AM w35Q== 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=zLOwvReqmhDb2j0Rm4OFDu4DdL2tfH5E0Yyw2x2mEdo=; b=Q9js3Xo41Op1eu5ni1znB9UarXKi27bWZqbI2m3VOHMLq1JYYumm6r3hm426kMPe7H MaNCz3+vrhQ37G/RuzEUotrSG5vsyTujam6CBNM9G4K1nseFnffcyI7PrxsX0+gSGhf/ B0zoLkau4/mTx8blpJkrxIdB6yPivvMW5ngdkxbaskuhCAQHh6eJ2iTT15MQJ1CcNy3/ bA/Hhg149WGEVR2j12hPT27xJJ3bd34owjbqPgowbhwuh2xlEX65k0speNJBJcl9/VvT 1C/y+1hwWVwb1Kr+/20fFLq5RPKISadPiSK8tlCwgXIsS3Q3J3ZW1G65UbJamIFvvYRf biOg== X-Gm-Message-State: APjAAAUaynnKI22MNd5fUAeUWV5Xndz3DXAgotP2ecusaC2BVJmfQz1k mo8Kxsqr1rIEPApGG7qyF29mUQIu X-Google-Smtp-Source: APXvYqx01NZtpB/BNvMHS9yPs7DJbWaali/Gv64iQ9LLnJ0NUu786ufQu42XlNgbz8AJbVXUjjU3yg== X-Received: by 2002:a17:90a:f0c1:: with SMTP id fa1mr3214147pjb.129.1580874550076; Tue, 04 Feb 2020 19:49:10 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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 05/14] drm/amdgpu/fence: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:43 -0500 Message-Id: <20200205034852.4157-6-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 84c5e9f23c76..bcd10daa6e39 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1245,6 +1245,9 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) dev_err(adev->dev, "failed to register debugfs file for SA\n"); } + if (amdgpu_debugfs_fence_init(adev)) + dev_err(adev->dev, "fence debugfs file creation failed\n"); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 3c01252b1e0e..7531527067df 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -503,9 +503,6 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, */ int amdgpu_fence_driver_init(struct amdgpu_device *adev) { - if (amdgpu_debugfs_fence_init(adev)) - dev_err(adev->dev, "fence debugfs file creation failed\n"); - return 0; } From patchwork Wed Feb 5 03:48:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365745 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 39CC517E0 for ; Wed, 5 Feb 2020 03:49:28 +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 18B0F2072B for ; Wed, 5 Feb 2020 03:49:28 +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="noFY08i0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18B0F2072B 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 00E8C6F461; Wed, 5 Feb 2020 03:49:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30BD36F45E; Wed, 5 Feb 2020 03:49:12 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id j7so301607plt.1; Tue, 04 Feb 2020 19:49: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=CDVwG+Zcj9UBGLRE3/MPdG+p0RG+kmWgw3dCJvKALc8=; b=noFY08i0+7oaqGY1b+pEf63ZwPmlTx2X5Jjn2y6maV2AeqcFdB/1jIEB+feWm8tatU ImjozHDluJi5r4vQOCxjyLO2X8VtT3M23veP5Q9ouhIbwXss1WthNLWRyIxyy8HLS6Ws Nxras/GBLHzZUSAuC6IPEBdPCSBEPvtHvn/pE+LbILYjd1XGeOIIGEyuDnTf5icHj5oD Mok1LncxWsEXMisQWOIJecg038ibQp+/Y/J+Ro8L1jxegpFD0WHbg1HAG1N40FeNgb5X PB+tznCC32lXEFgGClvGM4EtB0k9dJ43Z4HzUE6+K/S6JVyxKWYu8aUlIGSopfnUbDDF zgVA== 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=CDVwG+Zcj9UBGLRE3/MPdG+p0RG+kmWgw3dCJvKALc8=; b=IeTAErtGOpLfq4yJeJNftnRRAQm4X8TnfvqeJirHMVyCe+c6ZcaNIa18uKJP/3/GzV A1CJixA+IWPG4l8HkaKS1Y44RegvmrYrB6vdVQ/dGiECDa9qn/wSU5D35RFjd3YP6uDK O3OhQDsJowpVkGNGxW+PSw/WrfeTp3JllajIKxFxHWpcnjT9M2uyJNhlUOaXv0dycucS 1BSDo6ajCBOSIDWyJIJ2onlBr1yMTjqqCeQaHgeT/4zs6kag/iJoffUgRrLJTto9h9de iWo+u7UClcgCbwPoWyn9FeXUdqLHdoFgSYGLw/1nmFDWiDR/2YlXOeYAN50hbDjcXjGW l3Vw== X-Gm-Message-State: APjAAAX30bYBSsuiSrPxSM8mZRrrleHhg7/c0WZY37J3EYcxR5ZhD00b 8w/v0cJggLSmp9WUYWL3sTfWdnnp X-Google-Smtp-Source: APXvYqycyXHbzDBmF40ObmWjnRGxoKm2QmzwGR5cEoB1gy27DTHrFxbEcZWzGIvuX9bxvZv6r0OJ5A== X-Received: by 2002:a17:90a:d990:: with SMTP id d16mr3109650pjv.143.1580874551517; Tue, 04 Feb 2020 19:49:11 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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/14] drm/amdgpu/gem: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:44 -0500 Message-Id: <20200205034852.4157-7-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index bcd10daa6e39..cb7db7edfc3f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1248,6 +1248,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (amdgpu_debugfs_fence_init(adev)) dev_err(adev->dev, "fence debugfs file creation failed\n"); + r = amdgpu_debugfs_gem_init(adev); + if (r) + DRM_ERROR("registering gem debugfs failed (%d).\n", r); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 3b09897eb1e9..64a275664c72 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_gem_init(adev); - if (r) - DRM_ERROR("registering gem debugfs failed (%d).\n", r); - r = amdgpu_debugfs_regs_init(adev); if (r) DRM_ERROR("registering register debugfs failed (%d).\n", r); From patchwork Wed Feb 5 03:48:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365747 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 8B3EC14B4 for ; Wed, 5 Feb 2020 03:49: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 670BB2072B for ; Wed, 5 Feb 2020 03:49: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="kVOk615n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 670BB2072B 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 2F34E6F463; Wed, 5 Feb 2020 03:49:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9DA1B6F460; Wed, 5 Feb 2020 03:49:13 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id c23so293821plz.4; Tue, 04 Feb 2020 19:49: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=GFZVnpWX6GPvkc8CRw6ouzRBI+o08kr/Vo6z+I1dW8k=; b=kVOk615nIlY7oB0+uFpx6RsDVw0Zy/DJ37Q9akr6doTtPtDj81x8TlTzYxHXowuojB Cl+ADSsIl893wAgEaSii9oqXndSpIqrG7VedPTacknryR5djFMcNK0yDDWLTvFMD+Su0 HHahxK+0viOw3QKkBOtZfOSkQrUaxKgfp9uLUmzS2RbAClxk7YX8wTuwadW4Fy4V5GAB RbQFA5swe4+LcJrCPG8pqdwxTe5wIQFnDekcTSF3LNrMy4NVowMyLFKXw84n265MiCUK awqTzCWJnJNJrt+sxntLgROHk5YhcNlGjSUEAIukzVBMwO7xitUxthMsszhLduGLduy0 l5LA== 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=GFZVnpWX6GPvkc8CRw6ouzRBI+o08kr/Vo6z+I1dW8k=; b=JndonuZ31juZJEwO8oipY87UULEUfKLVU+2FexxaGJReqCzHbRfbz/pqxo9cK1JoWv zEpje/iZl4kUC0M3DUgroRjWZb7jWW66LHSZbPUT8b/w8aINBb4Zb97R106S7/Q4YrdB RdEpMzs7WuqIH3x7esnM67qRv0M4VfXLk+O4UZNk5UGcRv7kFqaEORzhByqZsQFKYNG4 WPYkc7up6hAxx7VEbZKq5Z1t8JwpJe6wXao+xGVsHSFX3qu0+AnEj+XWoXQl0FBQ3CK8 y0ZBKev1bTJfZxAUvLvShMUxL2xpmT+NURDtHxotam75NptXE+n8JNX8VIpEpnizitpY aZPA== X-Gm-Message-State: APjAAAUkzaAjZ05JfSH+ZL9WSYZLHNLSy1f524xHVv5SJvpC/IInKNoc dPZzxPzGkWcOHiM+yfaYP6rQqbFD X-Google-Smtp-Source: APXvYqzkS1+gtfR/ovS+CG6lciBVj0Ud2+yJtWVkJMwyDdYWdf4yhv7hF9kaxvgHhEjxzMAMu4OIFQ== X-Received: by 2002:a17:90b:3011:: with SMTP id hg17mr3146956pjb.90.1580874552903; Tue, 04 Feb 2020 19:49:12 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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/14] drm/amdgpu/regs: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:45 -0500 Message-Id: <20200205034852.4157-8-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index cb7db7edfc3f..7721f1416cdb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1252,6 +1252,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (r) DRM_ERROR("registering gem debugfs failed (%d).\n", r); + r = amdgpu_debugfs_regs_init(adev); + if (r) + DRM_ERROR("registering register debugfs failed (%d).\n", r); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 64a275664c72..d84a61e18bf8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_regs_init(adev); - if (r) - DRM_ERROR("registering register debugfs failed (%d).\n", r); - r = amdgpu_debugfs_firmware_init(adev); if (r) DRM_ERROR("registering firmware debugfs failed (%d).\n", r); From patchwork Wed Feb 5 03:48:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365749 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 9C9ED921 for ; Wed, 5 Feb 2020 03:49: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 7B6532072B for ; Wed, 5 Feb 2020 03:49: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="h73C028v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B6532072B 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 4AA746F462; Wed, 5 Feb 2020 03:49:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id 09CC96F468; Wed, 5 Feb 2020 03:49:15 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id ay11so301147plb.0; Tue, 04 Feb 2020 19:49: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=54+gTNGx30TsJEkymgEeo0vNH7o4QcjeVXuCTdIvfec=; b=h73C028vHLX5A8HMT9nkh7emt4+BlLB0oRbyhgZe29UseHTWJtnXLXQyZRrMiPn1+M ov/+z3Zlx82lcu+cMcIgR2V5lMO4mdMeYL5LDmhULCssBiBj+jWJ1LHa7U/eqkdYEcOC zilZuDptomZRDl12EhmDB0aRlyjsTbZPcCefZG6WmLIC+2girKSof/vAamH+4MhIe1gy IvkdJJOAGm3VBDmZZ+wqowUwhQA73DFS3sMevUYPVuIoGMT1f2qFgOVMtWNymYgM5CSb vmeVnJ6om2uJCPmxHwHWu/M9snLe9dQgOJpC29jmtpUBFYPhVmmqXQzIpgS4Q+nQSjzt 6CGw== 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=54+gTNGx30TsJEkymgEeo0vNH7o4QcjeVXuCTdIvfec=; b=PJX4yAOuvb/23xtlBdW1KuIPdisLeAx0FXSKn3qcXx5GXm/Jabl5MwCEjNamzPYzGU xZnLl0HwVeWBUuOc2oYrFO4GmvdjynnbCFbszEF+hsEb4IoQde9+lorBHhhfAGed7rhw t/czenMvFyAD20urO0t0MYYIJ9W9fxuhkBGCBXZtXmfdVwvgh2cMz7Y2AjWveczKIcj8 zhBUH8WWqnEcPwIsj1+mRh65PhdIagmwOKzrQOdD0piJ5ElL89r2EwF3gmppDLkbbNah MgiNZTtGdgC34LzdBO2OisYX+pxd5yxUu2TSstPPUqFsLzlqUjDxsg/FWwNMPLTCtfyu g6AQ== X-Gm-Message-State: APjAAAUSCfaquWDr8PTO3bJVFy2XS/4NF0oORFAOLAQl2Ghw3IfgmHj7 /H/8z5hXFvs6JK8gh0QrZLYSBfxg X-Google-Smtp-Source: APXvYqzPtkfEpAcolMlRsIZ3OqTPy1UQHVZZ1gSB2U7jvnWRftH0wnu8JiLGnf8ep2XugBhUZL7EFQ== X-Received: by 2002:a17:90a:20aa:: with SMTP id f39mr3221264pjg.35.1580874554364; Tue, 04 Feb 2020 19:49:14 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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/14] drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:46 -0500 Message-Id: <20200205034852.4157-9-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 7721f1416cdb..5bf43f20ec30 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1256,6 +1256,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (r) DRM_ERROR("registering register debugfs failed (%d).\n", r); + r = amdgpu_debugfs_firmware_init(adev); + if (r) + DRM_ERROR("registering firmware debugfs failed (%d).\n", r); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index d84a61e18bf8..4dc7145368fc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_firmware_init(adev); - if (r) - DRM_ERROR("registering firmware debugfs failed (%d).\n", r); - r = amdgpu_debugfs_init(adev); if (r) DRM_ERROR("Creating debugfs files failed (%d).\n", r); From patchwork Wed Feb 5 03:48:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365751 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 3BEFF14B4 for ; Wed, 5 Feb 2020 03:49:33 +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 1AE8C2072B for ; Wed, 5 Feb 2020 03:49:33 +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="ZAN5xjdM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AE8C2072B 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 1CEE26F455; Wed, 5 Feb 2020 03:49:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B8056F464; Wed, 5 Feb 2020 03:49:16 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id y1so289303plp.7; Tue, 04 Feb 2020 19:49: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=9aDTcgd6K3FAKk5HdP+fv9xU5kzD6Uz3SUrcwxPQ0SM=; b=ZAN5xjdMmvcTQ7ChhBvDoOtd5BlBBEX52tXnohLBBshRT/TYtgN3zPAME05kTCqNxE LyPxE9nVmLpMzTqw5SufqDopm74J/wFobLCnR4DMJq/YC/lxp1vb3VRtBZ2EHlEbh5cZ e82sL5tldSOXqzMDspLlxh63ovCQqQrFc3uJ8Ls4YpauqjZJKsUMWkSb26Gvxwg7jjmv xE0Nt0GSeY0gRY0ywY/bJmiqWQxSVSKtQC1jcFkVZql5b+J6+7y5hezcddDv26+78kfH daD7EQ1mS4L4fOAv24vZvP7eFl4l/ORcjYCH+bMFfhr8UTPs0CPL1lbaokUu8NcJDrGp k9UQ== 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=9aDTcgd6K3FAKk5HdP+fv9xU5kzD6Uz3SUrcwxPQ0SM=; b=mLm2COzjyFj01lHCZgCQiX0o4jwQr8BQ5G+dSWtF9v3v5TKwfzQFBAEYCg2XcwPa+I isdf5roTXmRRSDrq541U0fHVuis6+NpJ9hsgXclLli/eMah/f82hYWUC/+87tlC2rGKv YnK3FEDlpvVKlxllqJsAUNvn6tYTe2ncraWxpQMNDQkGlkQgDewq96wrmja09DdMn3OP fe1wd5Y2fjSFzMPUfhANF2ylwM7U95xP4zJsR0SkW+6SXchn6LZ6z1n+xvuGIrFKGioq A7x6kCM5esIVCUJx5Wr2GbbvY6vC/l8KLLn9drvbV3IGYTBAgqzBnobWiAGt1TSrZMhe kjXg== X-Gm-Message-State: APjAAAV0YGeerofabE5m4BgLn5rncFBrxoEyKRSlEo7AxT+UuFuxJoiE FaPKmq+Caj8jw782hB1sc8HLEyAG X-Google-Smtp-Source: APXvYqwbISoDX74M+dv40baLoLuwFbVrg3KALDo1iO5DeZ6+YWTXPrFVwFfYeS8eni5avV0IV1QOdQ== X-Received: by 2002:a17:90a:a08e:: with SMTP id r14mr3214764pjp.120.1580874555778; Tue, 04 Feb 2020 19:49:15 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49:15 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 09/14] drm/amdgpu: don't call drm_connector_register for non-MST ports Date: Tue, 4 Feb 2020 22:48:47 -0500 Message-Id: <20200205034852.4157-10-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" The core does this for us now. 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 d0ddbc9df264..7c094bfe07e2 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5839,7 +5839,6 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, drm_connector_attach_encoder( &aconnector->base, &aencoder->base); - drm_connector_register(&aconnector->base); #if defined(CONFIG_DEBUG_FS) connector_debugfs_init(aconnector); aconnector->debugfs_dpcd_address = 0; From patchwork Wed Feb 5 03:48:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365753 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 CA49114B4 for ; Wed, 5 Feb 2020 03:49:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A73F92072B for ; Wed, 5 Feb 2020 03:49: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="XGMbVzwg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A73F92072B 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 61EA76F466; Wed, 5 Feb 2020 03:49:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id C94BC6F455; Wed, 5 Feb 2020 03:49:17 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id w21so259727pgl.9; Tue, 04 Feb 2020 19:49: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=kegdYWqGxBdCcQ+t0XrzYVFcSJhMX/TPpx7RwDN0cnM=; b=XGMbVzwgYr7dlV32Zui3wSQfvAhAKe4BhFE1bEn2QbQXL7Wr9wQX2PN9vLxudK9O5q l8af3Lb9gY6+IC09DMJsFsUMBfcTFNXRvLEcx7kBbDt6T4GEalLlWvifIceI353HlkCG VJcjRYcgpE5LwINrYtyLAxyuV4AkGZGS7nbwvwMnYolMkizHLa9SAtkRoHA5836WhSMj wudSZTih2Vh1KBg7ycRSSfQzTfy0ViT5GBDdiysTmSJp+tp9b83n3pYpI/AOhDSjfrXO iehqxqSk2FMtJbM3YkjcVY5u9n6b2+DKZnwB7npREffyMgue4b2mLZiEqb6y6r1Z1jhm Jlng== 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=kegdYWqGxBdCcQ+t0XrzYVFcSJhMX/TPpx7RwDN0cnM=; b=V1W1b8kfnm82bd1Be4CotibDMaacw9zYXnvNvSpXajAKi8xyFcORTB6VUtAnFBT3ER cdT8C9WU+rcyuUEjoh3BZiEecaxqpREmo+XapjnYhdvem9JykZF8TFuVGuLf9fvzRa8v WVHyXdZf1SnsA1POXPP/SQyAo53bm3VBJz8U4T91hOPck80nRxEyXbYCb6b3uSIPhCgX shf+nNpzMwZFVtgC9XZB4YcG3e6NtCeHoB66TWIZX0KWDy7CwarNVLxZLC13dPd9z33K xPv6RBlzJel80YhRCm7BVLnC470T5icfLPfnjZzBoLMCYXqUPXwDr4WeFXzK008D5N4y EnaA== X-Gm-Message-State: APjAAAUvmXkZRb5Tdbi2NDy94lr6VCkICTPE+VwnNYBq3d9DRYYRM0rq jpSo375/Vu6WlofRlvF1QeEiGZnr X-Google-Smtp-Source: APXvYqxcktnWDKo7ibOkUyfrzoMLz3hfNspjWRyR8nmimv0wvNL4a0tyg589g+899WK/ViPlfJQpPA== X-Received: by 2002:a63:1807:: with SMTP id y7mr32812637pgl.94.1580874557135; Tue, 04 Feb 2020 19:49:17 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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 10/14] drm/amdgpu/display: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:48 -0500 Message-Id: <20200205034852.4157-11-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++++++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 5bf43f20ec30..82d30bae2ba0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -32,6 +32,7 @@ #include "amdgpu.h" #include "amdgpu_pm.h" +#include "amdgpu_dm_debugfs.h" /** * amdgpu_debugfs_add_files - Add simple debugfs entries @@ -1260,6 +1261,11 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) if (r) DRM_ERROR("registering firmware debugfs failed (%d).\n", r); + if (amdgpu_device_has_dc_support(adev)) { + if (dtn_debugfs_init(adev)) + DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n"); + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 7c094bfe07e2..efe74a8a8ace 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -991,11 +991,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) goto error; } -#if defined(CONFIG_DEBUG_FS) - if (dtn_debugfs_init(adev)) - DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n"); -#endif - DRM_DEBUG_DRIVER("KMS initialized.\n"); return 0; From patchwork Wed Feb 5 03:48:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365757 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 B6F1614B4 for ; Wed, 5 Feb 2020 03:49:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95C5F2072B for ; Wed, 5 Feb 2020 03:49:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QzqWgKw0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95C5F2072B 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 4863B6F46B; Wed, 5 Feb 2020 03:49:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by gabe.freedesktop.org (Postfix) with ESMTPS id 559326F465; Wed, 5 Feb 2020 03:49:19 +0000 (UTC) Received: by mail-pj1-x1041.google.com with SMTP id ep11so362865pjb.2; Tue, 04 Feb 2020 19:49: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=NrDPCoOEGpz0oG/Pf98BK1LffHnuo/Wjgd35wlGcuy4=; b=QzqWgKw0JmUcrXCwJcD121saAxq1nl3TZMTvxJwuK2C/siItB/TEwoAeS2R/597t/C rdbqx939AYt9TVfrtNzllWbDsc/PUay1qmo/Ogq7TPk0KrypZY5CByoCyTQwNUrfgjtX TR8O8fZMCh3UJvLwpT1802mvLyb+yvFeTRmVmUlpkVHDqrHmO6+gCNM86qTA9FtxjTq5 gRF7919c0oPFzVaofMn7qGjnSnxAapugvEYjdIydA9bskRWU5CZh0VxQZyIiT4utciRD b0Df0mNaSymVgUi1KLGAU6aIkBCqC9EoSGaxLB/QFKzUr4xdb/Eko/BGgjmCjoS7D4WR o6GA== 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=NrDPCoOEGpz0oG/Pf98BK1LffHnuo/Wjgd35wlGcuy4=; b=IQyez3BMss/w5cX2JOg9vx/YxHMN2IuDrmvW7YzvKdKeot0BniX0kv4QfdqliKG/mE GmNqWwbUwcDt2Hbs2tAGWRapWzlc96DZv30vD8ga7/4C7AqO3zY60dOd6zV9zZJ+sA8d tQyjgY84Umbo5XCke8xC7BNGmja4aw48OPWKZ4HOH98z6c7l/1AHGhMBgQp4zmm+v4lX wUQ0DiL+Xr5ZPdnyw1W5E6bMQJm/zQMSCqUTe9z830+l/Y4uPtnPmxzN7mszxJ6THu6o S2oM63gYC/ApbAw/xfY8ldPetukg+dWxTaVa/BmGX6nQy64/RD6NyEZklMsQh2gaD5jm CDgA== X-Gm-Message-State: APjAAAUF7i4Kt2N/BtTUmeCIZB9tZiYb3ekSAYzi+CauqbkwLA/4GfhM 8kPBXsyfLFx2OJJZxJE2USzjyflp X-Google-Smtp-Source: APXvYqwxWksIXlwp8DFSu/hUe3TKWc+ndZD7PQAVx8RyTCJhsoTYD5SPQpiNGlOcGdKD2YVmK9nxEg== X-Received: by 2002:a17:90a:d804:: with SMTP id a4mr3134207pjv.11.1580874558539; Tue, 04 Feb 2020 19:49:18 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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 11/14] drm/amd/display: move dpcd debugfs members setup Date: Tue, 4 Feb 2020 22:48:49 -0500 Message-Id: <20200205034852.4157-12-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" Into the function that creates the debugfs files rather than setting them explicitly in the callers. 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 efe74a8a8ace..5b9154ecc690 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 f81d3439ee8c..3cafbba37aef 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 @@ -1008,6 +1008,9 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector) debugfs_create_file_unsafe("force_yuv420_output", 0644, dir, connector, &force_yuv420_output_fops); + connector->debugfs_dpcd_address = 0; + connector->debugfs_dpcd_size = 0; + } /* diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 5672f7765919..3959c942c88b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -158,8 +158,6 @@ amdgpu_dm_mst_connector_late_register(struct drm_connector *connector) #if defined(CONFIG_DEBUG_FS) connector_debugfs_init(amdgpu_dm_connector); - amdgpu_dm_connector->debugfs_dpcd_address = 0; - amdgpu_dm_connector->debugfs_dpcd_size = 0; #endif return drm_dp_mst_connector_late_register(connector, port); From patchwork Wed Feb 5 03:48:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365755 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 A0E9A921 for ; Wed, 5 Feb 2020 03:49: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 7FB672072B for ; Wed, 5 Feb 2020 03:49: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="hvpXgnt7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FB672072B 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 C36B96F46E; Wed, 5 Feb 2020 03:49:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA2186F469; Wed, 5 Feb 2020 03:49:20 +0000 (UTC) Received: by mail-pg1-x541.google.com with SMTP id 6so278456pgk.0; Tue, 04 Feb 2020 19:49: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=lFpfk0LO6j/KbpaQJmrUVbhYieQwFi3dFY7IvFTLRdc=; b=hvpXgnt7+5JikUjBNlpUMUvJE2KgUbalhxZFUoHjqv9/NSudR2nIKvNbk+HnoQkT/J Xlt4kdWUuqfwMI9RimMTJcVNs58N90FSp6WQVo31j2bORJgEEb2g++Ie0LpCvx37Dw7e jUksvzWKwMTuCJT1WFS7pwZegE/32Zoq8Jja4oyTdK/BoCifhSMENd4M3NkSaKU5Fq28 2JqGQP4ijhhu8qZNIHJZyZQwo7WofGaLiAxRv8qvRUQpkMLdXlBJPzVV0db0FQj4y4oL 4Mg12RHbDiqvhf9G5G868nWCoJlk60XbypO9v4Gf2kdQ2hCnnw8NU4XM3BioCmgbbX5h CqoA== 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=lFpfk0LO6j/KbpaQJmrUVbhYieQwFi3dFY7IvFTLRdc=; b=A0vvP+N8Qojja/opnA1+TDvivBDEQS+LUvhKr7RODq4kkFAq+jofiezdVKZsDa8Exd R5Ye0XMB4FfOjvEdmhI7vxZqoqJrvqpiRk3BaBpIceAHNI4MuHRBYFDSPGY4oabqZLWS 17H4sl63YE7ItSBUrAAYHSUqU6jv0AwhaniFZ50PwdV7WSzrnwKoVwPGYjk8lXInycCo ffEeT4ZyIRmGtngmh/14SkVuojmQ9MtwfZcmNSR8RJGj92TDsRkeQpYoRBlIvzUPGSPX 3CXhv9l0qVbmJpVU7cxo8BmSkdI98FYPz68RUUvaszUxXQSYRJRpFwZVVy3BjICheeaG fEHA== X-Gm-Message-State: APjAAAV1l36eAiVFc2fFNmspt6fqTYOk8ELL/nuBA6hYljl2puAiQE5U +QL9R8JymMmfkNYfIfm0lxjjw5Kg X-Google-Smtp-Source: APXvYqwLszKA+6Sle4k05CzybyE5Eev9F46zdB4kRWBt3PPyO8EoC193whqq7b5RftijYxf9TnTE2g== X-Received: by 2002:a63:d441:: with SMTP id i1mr36318377pgj.426.1580874559980; Tue, 04 Feb 2020 19:49:19 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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 12/14] drm/amdgpu/display: add a late register connector callback Date: Tue, 4 Feb 2020 22:48:50 -0500 Message-Id: <20200205034852.4157-13-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" To handle debugfs setup on non DP MST connectors. 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 5b9154ecc690..1d86b9d53a61 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4486,6 +4486,19 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector) return &new_state->base; } +static int +amdgpu_dm_connector_late_register(struct drm_connector *connector) +{ + struct amdgpu_dm_connector *amdgpu_dm_connector = + to_amdgpu_dm_connector(connector); + +#if defined(CONFIG_DEBUG_FS) + connector_debugfs_init(amdgpu_dm_connector); +#endif + + return 0; +} + static const struct drm_connector_funcs amdgpu_dm_connector_funcs = { .reset = amdgpu_dm_connector_funcs_reset, .detect = amdgpu_dm_connector_detect, @@ -4495,6 +4508,7 @@ static const struct drm_connector_funcs amdgpu_dm_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_set_property = amdgpu_dm_connector_atomic_set_property, .atomic_get_property = amdgpu_dm_connector_atomic_get_property, + .late_register = amdgpu_dm_connector_late_register, .early_unregister = amdgpu_dm_connector_unregister }; @@ -5834,10 +5848,6 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, drm_connector_attach_encoder( &aconnector->base, &aencoder->base); -#if defined(CONFIG_DEBUG_FS) - connector_debugfs_init(aconnector); -#endif - if (connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector_type == DRM_MODE_CONNECTOR_eDP) amdgpu_dm_initialize_dp_connector(dm, aconnector); From patchwork Wed Feb 5 03:48:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365759 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 B65D8921 for ; Wed, 5 Feb 2020 03:49:39 +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 9510F2072B for ; Wed, 5 Feb 2020 03:49:39 +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="l7tC4WfS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9510F2072B 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 0C7396F471; Wed, 5 Feb 2020 03:49:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3388D6F471; Wed, 5 Feb 2020 03:49:22 +0000 (UTC) Received: by mail-pj1-x1044.google.com with SMTP id m13so368461pjb.2; Tue, 04 Feb 2020 19:49:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UbEYu8dpoDwFHWVT9bHRG8zXCZE9xHAmgc6+mU485r0=; b=l7tC4WfS3jZlZsQswfLNcm8HhvJ3sRmOmHtKbm3uQ5s5/TK0YDOPP7JefJ0TBwmriw 71mcmO6Vdgh39/2D4pfJltaXCILG9BbmegJ+Wve6MGE6ahfZ7pkzDFlw3/1F9leVrPs3 WUkX1hKeiCLXp1uYwAzfixEmO1Q60qxWnmO9AmveGCqmwqmifCNsXuY+fKLmrxE+jE5v JEYqAALv/wRYcelCElGe+AGSH+7DeTq6kSvpqWVGDuGuLGnOkZ1MkDzvSS94PiP1LYzI 1nG3YcehwnrZSBqkMDSGTX5Xpy9Jv0TM+6S2mHFRYUK+9enzjoEGJONiSXMg288Rhwyw xs7A== 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=UbEYu8dpoDwFHWVT9bHRG8zXCZE9xHAmgc6+mU485r0=; b=lQH2m0qTMJ3bS7rh8oPl0iB5Vpun82ERuGVviBeRUDXbzQxb/PZTYO+Urcbn5xL1Tl lVRUAk4ORbDyG9LhHu33GqRX1lPmJy9o/EyCtdCr4BBk9wgl9i9NEch5uI0iL/ePbQ/Z Ccf5XyjuNHUURmq2LWShvOKWQOwDRRbSNDuK2wG+hUBeuIuG0FGM9QSDf+NP3M8lmykT MJFypVam19DbyAfEzsxGSnvQM5k7elZRnYSno93+LAZN2La7KPndlc61BAGLkEo6sdVG nzKxTRVLCf4e8KHU4VTQgdAogIHf+PFsd+pPq7RiF3SF9jsux3+xbRd2EoISvezURVkN JRQA== X-Gm-Message-State: APjAAAWa6MtdAumV/oDz9hPqZspIXLVZ9qLcuXbEDJV1Vv2U3GKVNunL lFS/07jQyK/bEk/aHuG2K5HlcaDu X-Google-Smtp-Source: APXvYqxTer2aYGDRtOxZTWP627iOIfs22N8VW5pRJvS7TXx4qClG8BZjcKT6oIA5eGEOcDLgp9KT0Q== X-Received: by 2002:a17:90a:178f:: with SMTP id q15mr3250185pja.132.1580874561340; Tue, 04 Feb 2020 19:49:21 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49: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 13/14] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs Date: Tue, 4 Feb 2020 22:48:51 -0500 Message-Id: <20200205034852.4157-14-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" 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. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 ++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 82d30bae2ba0..a7e6b5de2c62 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1218,7 +1218,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL, int amdgpu_debugfs_init(struct amdgpu_device *adev) { - int r; + int r, i; adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600, @@ -1266,12 +1266,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) DRM_ERROR("amdgpu: failed initialize dtn debugfs support.\n"); } + for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { + struct amdgpu_ring *ring = adev->rings[i]; + + if (!ring) + continue; + + if (amdgpu_debugfs_ring_init(adev, ring)) { + DRM_ERROR("Failed to register debugfs file for rings !\n"); + } + } + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, ARRAY_SIZE(amdgpu_debugfs_list)); } void amdgpu_debugfs_fini(struct amdgpu_device *adev) { + int i; + + for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { + struct amdgpu_ring *ring = adev->rings[i]; + + if (!ring) + continue; + + amdgpu_debugfs_ring_fini(ring); + } amdgpu_ttm_debugfs_fini(adev); debugfs_remove(adev->debugfs_preempt); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index e5c83e164d82..539be138260e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -48,9 +48,6 @@ * wptr. The GPU then starts fetching commands and executes * them until the pointers are equal again. */ -static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, - struct amdgpu_ring *ring); -static void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring); /** * amdgpu_ring_alloc - allocate space on the ring buffer @@ -334,10 +331,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, for (i = 0; i < DRM_SCHED_PRIORITY_MAX; ++i) atomic_set(&ring->num_jobs[i], 0); - if (amdgpu_debugfs_ring_init(adev, ring)) { - DRM_ERROR("Failed to register debugfs file for rings !\n"); - } - return 0; } @@ -367,8 +360,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring) &ring->gpu_addr, (void **)&ring->ring); - amdgpu_debugfs_ring_fini(ring); - dma_fence_put(ring->vmid_wait); ring->vmid_wait = NULL; ring->me = 0; @@ -485,8 +476,8 @@ static const struct file_operations amdgpu_debugfs_ring_fops = { #endif -static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, - struct amdgpu_ring *ring) +int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, + struct amdgpu_ring *ring) { #if defined(CONFIG_DEBUG_FS) struct drm_minor *minor = adev->ddev->primary; @@ -507,7 +498,7 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, return 0; } -static void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring) +void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring) { #if defined(CONFIG_DEBUG_FS) debugfs_remove(ring->ent); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index 5134d0dd6dc2..0d098dafd23c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h @@ -329,4 +329,8 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, int amdgpu_ring_test_helper(struct amdgpu_ring *ring); +int amdgpu_debugfs_ring_init(struct amdgpu_device *adev, + struct amdgpu_ring *ring); +void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring); + #endif From patchwork Wed Feb 5 03:48:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 11365761 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 E79B5921 for ; Wed, 5 Feb 2020 03:49: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 C60CC2072B for ; Wed, 5 Feb 2020 03:49: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="CurJJeQN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C60CC2072B 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 C53796F472; Wed, 5 Feb 2020 03:49:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CEFF6F471; Wed, 5 Feb 2020 03:49:23 +0000 (UTC) Received: by mail-pj1-x1043.google.com with SMTP id q39so372965pjc.0; Tue, 04 Feb 2020 19:49:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=39oCmI9qUkdyhIwqFqQP7H02Tg7cpRynqVrB8dE2OhI=; b=CurJJeQNPQ3DijC47bbIMk/vc6quEYqfcyW34asMXURKXN7o/exru7iFr1vT6HzQ/C z6YI5uybNae9IUf4DjmODLLIrGnCRzFd1AnJM46G9aTfmgXH106aOcJAeHxHcGqKw6p6 WX3wRaIeUz07d1rRajFeFZXhNTFpsepQpP6Jv2D/x6KYbFNorYa7cqX3Oj3CWUDT3vRt zR6SF6tJvLVYPscqj4QNeQykZngdNqdXrEZrBLY0Ioxim8lffsxMlwBsqh5MjOx6Ebt0 j6X5JsM5QxHlz9dHqXhSm5ybR2TGiFbifBzaHIEv50gmsndVjXdVB8F2ZuBttzJsM/rm 5Xlw== 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=39oCmI9qUkdyhIwqFqQP7H02Tg7cpRynqVrB8dE2OhI=; b=gfO6dvrO88QGSpLegAYwLahHl2wuxhvC3RlPnGcHGNGPpQRQ/nbqe06VLjPEim3MRZ FMo+yIGEjvf3YMgroZ3SCu3RkD8fWoaB8LlsUBd6n1D8Uy/4FlCuHqWJ/rFc/EwRR851 eewws+3dGxLig0uWUoXKwBYi64D0oToqIipsh8ZytvXeq6C450FwGu1EBHQxCgVF+6UA odBerpETB9mnf0wG38h52L9CSdN2wQi8qOh3/tL0XlzhV6uBaSniohRbuNSj9+//4RKD 0fcpqPSC8oKDXPNy3n1jhA8WoW0fM4flUddDUreGTmUFIX28/EuqBXtd4dulen46tN0n HvHA== X-Gm-Message-State: APjAAAWeoLdHQK9cI1Q2Me7exG2NJGUcR/p5S3Ofv80Hckp/t74Y/3jC QRj/TwFz8uRsNzjT2F7aSLuMv6vu X-Google-Smtp-Source: APXvYqxAnGtTgaSwKYi4u9jDzQVmhd4bZE+CtETrn27bc51pwAP45NNDH08SNa8pseMlWXrvcLwfdA== X-Received: by 2002:a17:902:124:: with SMTP id 33mr33835303plb.128.1580874562719; Tue, 04 Feb 2020 19:49:22 -0800 (PST) Received: from localhost.localdomain ([71.219.59.120]) by smtp.gmail.com with ESMTPSA id 200sm25320292pfz.121.2020.02.04.19.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 19:49:22 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 14/14] drm/amdgpu: drop legacy drm load and unload callbacks Date: Tue, 4 Feb 2020 22:48:52 -0500 Message-Id: <20200205034852.4157-15-alexander.deucher@amd.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200205034852.4157-1-alexander.deucher@amd.com> References: <20200205034852.4157-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" We've moved the debugfs handling into a centralized place so we can remove the legacy load an unload callbacks. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 4dc7145368fc..12aab522f459 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3091,10 +3091,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, } else adev->ucode_sysfs_en = true; - r = amdgpu_debugfs_init(adev); - if (r) - DRM_ERROR("Creating debugfs files failed (%d).\n", r); - if ((amdgpu_testing & 1)) { if (adev->accel_working) amdgpu_test_moves(adev); @@ -3216,7 +3212,6 @@ void amdgpu_device_fini(struct amdgpu_device *adev) amdgpu_ucode_sysfs_fini(adev); if (IS_ENABLED(CONFIG_PERF_EVENTS)) amdgpu_pmu_fini(adev); - amdgpu_debugfs_fini(adev); if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10) amdgpu_discovery_fini(adev); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index f26532998781..9753c55b317d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -1031,6 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct drm_device *dev; + struct amdgpu_device *adev; unsigned long flags = ent->driver_data; int ret, retry = 0; bool supports_atomic = false; @@ -1100,6 +1101,8 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, dev); + amdgpu_driver_load_kms(dev, ent->driver_data); + retry_init: ret = drm_dev_register(dev, ent->driver_data); if (ret == -EAGAIN && ++retry <= 3) { @@ -1110,6 +1113,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, } else if (ret) goto err_pci; + adev = dev->dev_private; + ret = amdgpu_debugfs_init(adev); + if (ret) + DRM_ERROR("Creating debugfs files failed (%d).\n", ret); + return 0; err_pci: @@ -1123,6 +1131,7 @@ static void amdgpu_pci_remove(struct pci_dev *pdev) { struct drm_device *dev = pci_get_drvdata(pdev); + struct amdgpu_device *adev = dev->dev_private; #ifdef MODULE if (THIS_MODULE->state != MODULE_STATE_GOING) @@ -1130,6 +1139,8 @@ amdgpu_pci_remove(struct pci_dev *pdev) DRM_ERROR("Hotplug removal is not supported\n"); drm_dev_unplug(dev); drm_dev_put(dev); + amdgpu_debugfs_fini(adev); + amdgpu_driver_unload_kms(dev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); } @@ -1434,11 +1445,9 @@ static struct drm_driver kms_driver = { DRIVER_GEM | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE, - .load = amdgpu_driver_load_kms, .open = amdgpu_driver_open_kms, .postclose = amdgpu_driver_postclose_kms, .lastclose = amdgpu_driver_lastclose_kms, - .unload = amdgpu_driver_unload_kms, .get_vblank_counter = amdgpu_get_vblank_counter_kms, .enable_vblank = amdgpu_enable_vblank_kms, .disable_vblank = amdgpu_disable_vblank_kms,