* [PATCH] drm/amd/display: fix dtm unloading
@ 2020-02-10 15:17 Bhawanpreet Lakha
2020-02-10 17:56 ` Xu, Feifei
0 siblings, 1 reply; 2+ messages in thread
From: Bhawanpreet Lakha @ 2020-02-10 15:17 UTC (permalink / raw)
To: amd-gfx
Cc: alexander.deucher, Bhawanpreet Lakha, harry.wentland,
nicholas.kazlauskas
there was a type in the terminate command.
We should be calling psp_dtm_unload() instead of psp_hdcp_unload()
Fixes: 143f23053333 ("drm/amdgpu: psp DTM init"
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 26 ++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 939a114605c0..a16c8101e250 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -1013,6 +1013,30 @@ static int psp_dtm_initialize(struct psp_context *psp)
return 0;
}
+static int psp_dtm_unload(struct psp_context *psp)
+{
+ int ret;
+ struct psp_gfx_cmd_resp *cmd;
+
+ /*
+ * TODO: bypass the unloading in sriov for now
+ */
+ if (amdgpu_sriov_vf(psp->adev))
+ return 0;
+
+ cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
+ if (!cmd)
+ return -ENOMEM;
+
+ psp_prep_ta_unload_cmd_buf(cmd, psp->dtm_context.session_id);
+
+ ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr);
+
+ kfree(cmd);
+
+ return ret;
+}
+
int psp_dtm_invoke(struct psp_context *psp, uint32_t ta_cmd_id)
{
/*
@@ -1037,7 +1061,7 @@ static int psp_dtm_terminate(struct psp_context *psp)
if (!psp->dtm_context.dtm_initialized)
return 0;
- ret = psp_hdcp_unload(psp);
+ ret = psp_dtm_unload(psp);
if (ret)
return ret;
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amd/display: fix dtm unloading
2020-02-10 15:17 [PATCH] drm/amd/display: fix dtm unloading Bhawanpreet Lakha
@ 2020-02-10 17:56 ` Xu, Feifei
0 siblings, 0 replies; 2+ messages in thread
From: Xu, Feifei @ 2020-02-10 17:56 UTC (permalink / raw)
To: Lakha, Bhawanpreet
Cc: Deucher, Alexander, Wentland, Harry, Kazlauskas, Nicholas, amd-gfx
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
> On Feb 10, 2020, at 23:17, Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> wrote:
>
> there was a type in the terminate command.
>
> We should be calling psp_dtm_unload() instead of psp_hdcp_unload()
>
> Fixes: 143f23053333 ("drm/amdgpu: psp DTM init"
> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 26 ++++++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 939a114605c0..a16c8101e250 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -1013,6 +1013,30 @@ static int psp_dtm_initialize(struct psp_context *psp)
> return 0;
> }
>
> +static int psp_dtm_unload(struct psp_context *psp)
> +{
> + int ret;
> + struct psp_gfx_cmd_resp *cmd;
> +
> + /*
> + * TODO: bypass the unloading in sriov for now
> + */
> + if (amdgpu_sriov_vf(psp->adev))
> + return 0;
> +
> + cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
> + if (!cmd)
> + return -ENOMEM;
> +
> + psp_prep_ta_unload_cmd_buf(cmd, psp->dtm_context.session_id);
> +
> + ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr);
> +
> + kfree(cmd);
> +
> + return ret;
> +}
> +
> int psp_dtm_invoke(struct psp_context *psp, uint32_t ta_cmd_id)
> {
> /*
> @@ -1037,7 +1061,7 @@ static int psp_dtm_terminate(struct psp_context *psp)
> if (!psp->dtm_context.dtm_initialized)
> return 0;
>
> - ret = psp_hdcp_unload(psp);
> + ret = psp_dtm_unload(psp);
> if (ret)
> return ret;
>
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CFeifei.Xu%40amd.com%7C084dc5c1ce774b58b9b808d7ae3c6019%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637169446683818770&sdata=7uHs0%2BZa0PrYXdEmhrSfWeXlh073N2PYO7N87SH9vO4%3D&reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-10 17:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 15:17 [PATCH] drm/amd/display: fix dtm unloading Bhawanpreet Lakha
2020-02-10 17:56 ` Xu, Feifei
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.