diff mbox series

[v2,3/7] drm/msm/dpu: release resources on modeset failure

Message ID 1550107156-17625-4-git-send-email-jsanka@codeaurora.org (mailing list archive)
State Not Applicable, archived
Headers show
Series move dpu resource parsing to encoder modeset | expand

Commit Message

Jeykumar Sankaran Feb. 14, 2019, 1:19 a.m. UTC
release resources allocated in mode_set if any of
the hw check fails. Most of these checks are not
necessary and they will be removed in the follow up
patches with state based resource allocations.

Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Sean Paul March 4, 2019, 6:09 p.m. UTC | #1
On Wed, Feb 13, 2019 at 05:19:12PM -0800, Jeykumar Sankaran wrote:
> release resources allocated in mode_set if any of
> the hw check fails. Most of these checks are not
> necessary and they will be removed in the follow up
> patches with state based resource allocations.
> 
> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 941ac25..45617b9 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -1025,13 +1025,13 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
>  			if (!dpu_enc->hw_pp[i]) {
>  				DPU_ERROR_ENC(dpu_enc, "no pp block assigned"
>  					     "at idx: %d\n", i);
> -				return;
> +				goto error;
>  			}
>  
>  			if (!hw_ctl[i]) {
>  				DPU_ERROR_ENC(dpu_enc, "no ctl block assigned"
>  					     "at idx: %d\n", i);
> -				return;
> +				goto error;
>  			}
>  
>  			phys->hw_pp = dpu_enc->hw_pp[i];
> @@ -1044,6 +1044,9 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
>  	}
>  
>  	dpu_enc->mode_set_complete = true;
> +
> +error:
> +	dpu_rm_release(&dpu_kms->rm, drm_enc);
>  }
>  
>  static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc)
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 941ac25..45617b9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1025,13 +1025,13 @@  static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 			if (!dpu_enc->hw_pp[i]) {
 				DPU_ERROR_ENC(dpu_enc, "no pp block assigned"
 					     "at idx: %d\n", i);
-				return;
+				goto error;
 			}
 
 			if (!hw_ctl[i]) {
 				DPU_ERROR_ENC(dpu_enc, "no ctl block assigned"
 					     "at idx: %d\n", i);
-				return;
+				goto error;
 			}
 
 			phys->hw_pp = dpu_enc->hw_pp[i];
@@ -1044,6 +1044,9 @@  static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 	}
 
 	dpu_enc->mode_set_complete = true;
+
+error:
+	dpu_rm_release(&dpu_kms->rm, drm_enc);
 }
 
 static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc)