All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hawking Zhang <Hawking.Zhang@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Subject: [PATCH 7/8] drm/amdgpu: cache psp runtime boot_cfg_bitmask in sw_int
Date: Fri, 11 Jun 2021 15:05:45 +0800	[thread overview]
Message-ID: <1623395146-2162-7-git-send-email-Hawking.Zhang@amd.com> (raw)
In-Reply-To: <1623395146-2162-1-git-send-email-Hawking.Zhang@amd.com>

PSP runtime boot_cfg_bitmask carries various psp bl
feature bit mask that can be used by driver. Cache
it in sw_init for further usage.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: John Clements <john.clements@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 7 +++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index dc786c91ec9d..28f95c5cd373 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -237,6 +237,7 @@ static int psp_sw_init(void *handle)
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 	struct psp_context *psp = &adev->psp;
 	int ret;
+	struct psp_runtime_boot_cfg_entry boot_cfg_entry;
 
 	if (!amdgpu_sriov_vf(adev)) {
 		ret = psp_init_microcode(psp);
@@ -246,6 +247,12 @@ static int psp_sw_init(void *handle)
 		}
 	}
 
+	memset(&boot_cfg_entry, 0, sizeof(boot_cfg_entry));
+	if (psp_get_runtime_db_entry(adev,
+				PSP_RUNTIME_ENTRY_TYPE_BOOT_CONFIG,
+				&boot_cfg_entry))
+		psp->boot_cfg_bitmask = boot_cfg_entry.boot_cfg_bitmask;
+
 	ret = psp_memory_training_init(psp);
 	if (ret) {
 		DRM_ERROR("Failed to initialize memory training!\n");
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
index 4dad9b539f06..2bd85b505f2c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
@@ -378,6 +378,8 @@ struct psp_context
 	struct psp_securedisplay_context	securedisplay_context;
 	struct mutex			mutex;
 	struct psp_memory_training_context mem_train_ctx;
+
+	uint32_t			boot_cfg_bitmask;
 };
 
 struct amdgpu_psp_funcs {
-- 
2.17.1

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

  parent reply	other threads:[~2021-06-11  7:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  7:05 [PATCH 1/8] drm/amdgpu: update psp gfx i/f to support dynamic GECC Hawking Zhang
2021-06-11  7:05 ` [PATCH 2/8] drm/amdgpu: allow different boot configs Hawking Zhang
2021-06-11  7:05 ` [PATCH 3/8] drm/amdgpu: add helper function to query gecc status in boot config Hawking Zhang
2021-06-11  7:05 ` [PATCH 4/8] drm/amdgpu: enable dynamic GECC support (v2) Hawking Zhang
2021-06-11  7:05 ` [PATCH 5/8] drm/amdgpu: add psp runtime db structures Hawking Zhang
2021-06-11  7:05 ` [PATCH 6/8] drm/amdgpu: add helper function to query psp runtime db entry (v2) Hawking Zhang
2021-06-30 11:08   ` Michel Dänzer
2021-06-11  7:05 ` Hawking Zhang [this message]
2021-06-11  7:05 ` [PATCH 8/8] drm/amdgpu: disable DRAM memory training when GECC is enabled Hawking Zhang

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=1623395146-2162-7-git-send-email-Hawking.Zhang@amd.com \
    --to=hawking.zhang@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 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.