All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: [PATCH 15/15] drm/amdgpu: drop legacy drm load and unload callbacks
Date: Fri,  7 Feb 2020 14:50:58 -0500	[thread overview]
Message-ID: <20200207195058.2354-16-alexander.deucher@amd.com> (raw)
In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com>

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 <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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,
-- 
2.24.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: [PATCH 15/15] drm/amdgpu: drop legacy drm load and unload callbacks
Date: Fri,  7 Feb 2020 14:50:58 -0500	[thread overview]
Message-ID: <20200207195058.2354-16-alexander.deucher@amd.com> (raw)
In-Reply-To: <20200207195058.2354-1-alexander.deucher@amd.com>

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 <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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,
-- 
2.24.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2020-02-07 19:51 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 19:50 [PATCH 00/15] amdgpu: remove load and unload callbacks (v3) Alex Deucher
2020-02-07 19:50 ` Alex Deucher
2020-02-07 19:50 ` [PATCH 01/15] drm/amdgpu: rename amdgpu_debugfs_preempt_cleanup Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 02/15] drm/amdgpu/ttm: move debugfs init into core amdgpu debugfs Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 03/15] drm/amdgpu/pm: " Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 04/15] drm/amdgpu/sa: " Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 05/15] drm/amdgpu/fence: " Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 06/15] drm/amdgpu/gem: " Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 07/15] drm/amdgpu/regs: " Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 08/15] drm/amdgpu/firmware: " Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 09/15] drm/amdgpu: don't call drm_connector_register for non-MST ports Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 10/15] drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2) Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 11/15] drm/amd/display: move dpcd debugfs members setup Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 12/15] drm/amdgpu/display: add a late register connector callback Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-04-08  4:09   ` Eric Biggers
2020-04-08  4:09     ` Eric Biggers
2020-02-07 19:50 ` [PATCH 13/15] drm/amdgpu/display: split dp connector registration (v2) Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-07 19:50 ` [PATCH 14/15] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs Alex Deucher
2020-02-07 19:50   ` Alex Deucher
2020-02-13  9:54   ` Daniel Vetter
2020-02-13  9:54     ` Daniel Vetter
2020-02-13 10:17     ` Christian König
2020-02-13 10:17       ` Christian König
2020-02-13 14:32       ` Alex Deucher
2020-02-13 14:32         ` Alex Deucher
2020-02-13 17:28         ` Christian König
2020-02-13 17:28           ` Christian König
2020-02-13 17:32           ` Alex Deucher
2020-02-13 17:32             ` Alex Deucher
2020-02-07 19:50 ` Alex Deucher [this message]
2020-02-07 19:50   ` [PATCH 15/15] drm/amdgpu: drop legacy drm load and unload callbacks Alex Deucher
2020-02-10 10:39 ` [PATCH 00/15] amdgpu: remove load and unload callbacks (v3) Thomas Zimmermann
2020-02-10 10:39   ` Thomas Zimmermann
2020-04-08  7:38 ` Thomas Zimmermann
2020-04-08  7:38   ` Thomas Zimmermann
2020-04-08 13:51   ` Alex Deucher
2020-04-08 13:51     ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2020-02-05 15:39 [PATCH 00/15] amdgpu: remove load and unload callbacks (v2) Alex Deucher
2020-02-05 15:40 ` [PATCH 15/15] drm/amdgpu: drop legacy drm load and unload callbacks Alex Deucher
2020-02-05 15:40   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200207195058.2354-16-alexander.deucher@amd.com \
    --to=alexdeucher@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.