[PATCH] drm/amdgpu: Bypass display ta if display hw is not available
Zhang, Hawking
Hawking.Zhang at amd.com
Thu Mar 14 13:24:53 UTC 2024
[AMD Official Use Only - General]
Thanks Alex!
Regards,
Hawking
-----Original Message-----
From: Alex Deucher <alexdeucher at gmail.com>
Sent: Thursday, March 14, 2024 21:23
To: Zhang, Hawking <Hawking.Zhang at amd.com>
Cc: amd-gfx at lists.freedesktop.org; Pillai, Aurabindo <Aurabindo.Pillai at amd.com>; Feng, Kenneth <Kenneth.Feng at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Wang, Yang(Kevin) <KevinYang.Wang at amd.com>
Subject: Re: [PATCH] drm/amdgpu: Bypass display ta if display hw is not available
On Thu, Mar 14, 2024 at 9:18 AM Hawking Zhang <Hawking.Zhang at amd.com> wrote:
>
> Do not load/invoke display TA if display hardware is not available
>
> Signed-off-by: Hawking Zhang <Hawking.Zhang at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 867397fe2e9d..e7d7fd2cc31d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -1830,6 +1830,10 @@ static int psp_hdcp_initialize(struct psp_context *psp)
> if (amdgpu_sriov_vf(psp->adev))
> return 0;
>
> + /* bypass hdcp initialization if dmu is harvested */
> + if (!amdgpu_device_has_display_hardware(psp->adev))
> + return 0;
> +
> if (!psp->hdcp_context.context.bin_desc.size_bytes ||
> !psp->hdcp_context.context.bin_desc.start_addr) {
> dev_info(psp->adev->dev, "HDCP: optional hdcp ta ucode
> is not available\n"); @@ -1862,6 +1866,9 @@ int psp_hdcp_invoke(struct psp_context *psp, uint32_t ta_cmd_id)
> if (amdgpu_sriov_vf(psp->adev))
> return 0;
>
> + if (!psp->hdcp_context.context.initialized)
> + return 0;
> +
> return psp_ta_invoke(psp, ta_cmd_id,
> &psp->hdcp_context.context); }
>
> @@ -1897,6 +1904,10 @@ static int psp_dtm_initialize(struct psp_context *psp)
> if (amdgpu_sriov_vf(psp->adev))
> return 0;
>
> + /* bypass dtm initialization if dmu is harvested */
> + if (!amdgpu_device_has_display_hardware(psp->adev))
> + return 0;
> +
> if (!psp->dtm_context.context.bin_desc.size_bytes ||
> !psp->dtm_context.context.bin_desc.start_addr) {
> dev_info(psp->adev->dev, "DTM: optional dtm ta ucode
> is not available\n"); @@ -1929,6 +1940,9 @@ int psp_dtm_invoke(struct psp_context *psp, uint32_t ta_cmd_id)
> if (amdgpu_sriov_vf(psp->adev))
> return 0;
>
> + if (!psp->dtm_context.context.initialized)
> + return 0;
> +
> return psp_ta_invoke(psp, ta_cmd_id,
> &psp->dtm_context.context); }
>
> @@ -2063,6 +2077,10 @@ static int psp_securedisplay_initialize(struct psp_context *psp)
> if (amdgpu_sriov_vf(psp->adev))
> return 0;
>
> + /* bypass securedisplay initialization if dmu is harvested */
> + if (!amdgpu_device_has_display_hardware(psp->adev))
> + return 0;
> +
> if (!psp->securedisplay_context.context.bin_desc.size_bytes ||
> !psp->securedisplay_context.context.bin_desc.start_addr) {
> dev_info(psp->adev->dev, "SECUREDISPLAY: securedisplay
> ta ucode is not available\n");
> --
> 2.17.1
>
More information about the amd-gfx
mailing list