From: Alex Deucher <alexdeucher@gmail.com>
To: amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 8/8] drm/amdgpu: add a wrapper for atom asic_init
Date: Mon, 24 Aug 2020 12:15:27 -0400 [thread overview]
Message-ID: <20200824161527.2001591-8-alexander.deucher@amd.com> (raw)
In-Reply-To: <20200824161527.2001591-1-alexander.deucher@amd.com>
This allows us to add asic specific workarounds for atom
asic init while keeping the adev specifics out of the
atombios parser code.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 6573e1112462..e41aa1e885ba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -653,6 +653,20 @@ static void amdgpu_block_invalid_wreg(struct amdgpu_device *adev,
BUG();
}
+/**
+ * amdgpu_device_asic_init - Wrapper for atom asic_init
+ *
+ * @dev: drm_device pointer
+ *
+ * Does any asic specific work and then calls atom asic init.
+ */
+static int amdgpu_device_asic_init(struct amdgpu_device *adev)
+{
+ amdgpu_asic_pre_asic_init(adev);
+
+ return amdgpu_atom_asic_init(adev->mode_info.atom_context);
+}
+
/**
* amdgpu_device_vram_scratch_init - allocate the VRAM scratch page
*
@@ -3203,7 +3217,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
goto failed;
}
DRM_INFO("GPU posting now...\n");
- r = amdgpu_atom_asic_init(adev->mode_info.atom_context);
+ r = amdgpu_device_asic_init(adev);
if (r) {
dev_err(adev->dev, "gpu post error!\n");
goto failed;
@@ -3552,7 +3566,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
/* post card */
if (amdgpu_device_need_post(adev)) {
- r = amdgpu_atom_asic_init(adev->mode_info.atom_context);
+ r = amdgpu_device_asic_init(adev);
if (r)
DRM_ERROR("amdgpu asic init failed\n");
}
@@ -4109,7 +4123,7 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive,
list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) {
if (need_full_reset) {
/* post card */
- if (amdgpu_atom_asic_init(tmp_adev->mode_info.atom_context))
+ if (amdgpu_device_asic_init(tmp_adev))
DRM_WARN("asic atom init failed!");
if (!r) {
--
2.25.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-08-24 16:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-24 16:15 [PATCH 1/8] drm/amdgpu: fix up DCHUBBUB_SDPIF_MMIO_CNTRL_0 handling Alex Deucher
2020-08-24 16:15 ` [PATCH 2/8] drm/amdgpu: add an asic callback for pre asic init Alex Deucher
2020-08-24 16:15 ` [PATCH 3/8] drm/amdgpu: add pre_asic_init callback for SI Alex Deucher
2020-08-28 8:06 ` Christian König
2020-08-28 13:38 ` Alex Deucher
2020-08-28 14:30 ` Christian König
2020-08-24 16:15 ` [PATCH 4/8] drm/amdgpu: add pre_asic_init callback for CIK Alex Deucher
2020-08-24 16:15 ` [PATCH 5/8] drm/amdgpu: add pre_asic_init callback for VI Alex Deucher
2020-08-24 16:15 ` [PATCH 6/8] drm/amdgpu: add pre_asic_init callback for SOC15 Alex Deucher
2020-08-24 16:15 ` [PATCH 7/8] drm/amdgpu: add pre_asic_init callback for navi Alex Deucher
2020-08-24 16:15 ` Alex Deucher [this message]
2020-08-24 18:13 ` [PATCH 8/8] drm/amdgpu: add a wrapper for atom asic_init Nirmoy
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=20200824161527.2001591-8-alexander.deucher@amd.com \
--to=alexdeucher@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox