diff mbox series

[v2,1/2] drm/msm/dsi: use msm_gem_kernel_put to free TX buffer

Message ID 20231012012909.450501-2-dmitry.baryshkov@linaro.org
State Accepted
Commit 69b321b2c3df4f7e51a9de587e41f324b0b717b0
Headers show
Series [v2,1/2] drm/msm/dsi: use msm_gem_kernel_put to free TX buffer | expand

Commit Message

Dmitry Baryshkov Oct. 12, 2023, 1:29 a.m. UTC
Use exiting function to free the allocated GEM object instead of
open-coding it. This has a bonus of internally calling
msm_gem_put_vaddr() to compensate for msm_gem_get_vaddr() in
msm_get_kernel_new().

Fixes: 1e29dff00400 ("drm/msm: Add a common function to free kernel buffer objects")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Abhinav Kumar Oct. 14, 2023, 12:33 a.m. UTC | #1
On 10/11/2023 6:29 PM, Dmitry Baryshkov wrote:
> Use exiting function to free the allocated GEM object instead of
> open-coding it. This has a bonus of internally calling
> msm_gem_put_vaddr() to compensate for msm_gem_get_vaddr() in
> msm_get_kernel_new().
> 
> Fixes: 1e29dff00400 ("drm/msm: Add a common function to free kernel buffer objects")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/gpu/drm/msm/dsi/dsi_host.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index fd2201cb62db..19019c764f11 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1180,8 +1180,7 @@  static void dsi_tx_buf_free(struct msm_dsi_host *msm_host)
 
 	priv = dev->dev_private;
 	if (msm_host->tx_gem_obj) {
-		msm_gem_unpin_iova(msm_host->tx_gem_obj, priv->kms->aspace);
-		drm_gem_object_put(msm_host->tx_gem_obj);
+		msm_gem_kernel_put(msm_host->tx_gem_obj, priv->kms->aspace);
 		msm_host->tx_gem_obj = NULL;
 	}