diff mbox series

[v5,18/19] drm/msm/dpu: relax parameter validation in encoders

Message ID 1536199708-23664-19-git-send-email-jsanka@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series clean up DPU for RM refactor | expand

Commit Message

Jeykumar Sankaran Sept. 6, 2018, 2:08 a.m. UTC
DPU, being over protective, validates every parameter of a
module. This change traces the call stack for some of encoder
functions affected by previous set of clean up patches and
cleans up unwanted validations.

changes in v5:
	- Introduced in the series

Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c          |  6 ------
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 14 --------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c |  6 ------
 3 files changed, 26 deletions(-)

Comments

Sean Paul Sept. 7, 2018, 1:30 p.m. UTC | #1
On Wed, Sep 05, 2018 at 07:08:27PM -0700, Jeykumar Sankaran wrote:
> DPU, being over protective, validates every parameter of a
> module. This change traces the call stack for some of encoder
> functions affected by previous set of clean up patches and
> cleans up unwanted validations.
> 
> changes in v5:
> 	- Introduced in the series
> 
> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c          |  6 ------
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 14 --------------
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c |  6 ------
>  3 files changed, 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 18f5d1d..e15d09f 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -441,12 +441,6 @@ void dpu_encoder_get_hw_resources(struct drm_encoder *drm_enc,
>  	struct dpu_encoder_virt *dpu_enc = NULL;
>  	int i = 0;
>  
> -	if (!hw_res || !drm_enc) {
> -		DPU_ERROR("invalid argument(s), drm_enc %d, res %d\n",
> -			  drm_enc != 0, hw_res != 0);
> -		return;
> -	}
> -
>  	dpu_enc = to_dpu_encoder_virt(drm_enc);
>  	DPU_DEBUG_ENC(dpu_enc, "\n");
>  
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> index f277a69..b2d7f0d 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> @@ -601,20 +601,6 @@ static void dpu_encoder_phys_cmd_get_hw_resources(
>  		struct dpu_encoder_phys *phys_enc,
>  		struct dpu_encoder_hw_resources *hw_res)
>  {
> -	struct dpu_encoder_phys_cmd *cmd_enc =
> -		to_dpu_encoder_phys_cmd(phys_enc);
> -
> -	if (!phys_enc) {
> -		DPU_ERROR("invalid encoder\n");
> -		return;
> -	}
> -
> -	if ((phys_enc->intf_idx - INTF_0) >= INTF_MAX) {
> -		DPU_ERROR("invalid intf idx:%d\n", phys_enc->intf_idx);
> -		return;
> -	}
> -
> -	DPU_DEBUG_CMDENC(cmd_enc, "\n");
>  	hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_CMD;
>  }
>  
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> index fd51fe6..6fc7060 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> @@ -539,12 +539,6 @@ static void dpu_encoder_phys_vid_get_hw_resources(
>  		struct dpu_encoder_phys *phys_enc,
>  		struct dpu_encoder_hw_resources *hw_res)
>  {
> -	if (!phys_enc || !hw_res) {
> -		DPU_ERROR("invalid arg(s), enc %d hw_res %d\n",
> -			  phys_enc != 0, hw_res != 0);
> -		return;
> -	}
> -
>  	hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_VIDEO;
>  }
>  
> -- 
> 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 18f5d1d..e15d09f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -441,12 +441,6 @@  void dpu_encoder_get_hw_resources(struct drm_encoder *drm_enc,
 	struct dpu_encoder_virt *dpu_enc = NULL;
 	int i = 0;
 
-	if (!hw_res || !drm_enc) {
-		DPU_ERROR("invalid argument(s), drm_enc %d, res %d\n",
-			  drm_enc != 0, hw_res != 0);
-		return;
-	}
-
 	dpu_enc = to_dpu_encoder_virt(drm_enc);
 	DPU_DEBUG_ENC(dpu_enc, "\n");
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index f277a69..b2d7f0d 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -601,20 +601,6 @@  static void dpu_encoder_phys_cmd_get_hw_resources(
 		struct dpu_encoder_phys *phys_enc,
 		struct dpu_encoder_hw_resources *hw_res)
 {
-	struct dpu_encoder_phys_cmd *cmd_enc =
-		to_dpu_encoder_phys_cmd(phys_enc);
-
-	if (!phys_enc) {
-		DPU_ERROR("invalid encoder\n");
-		return;
-	}
-
-	if ((phys_enc->intf_idx - INTF_0) >= INTF_MAX) {
-		DPU_ERROR("invalid intf idx:%d\n", phys_enc->intf_idx);
-		return;
-	}
-
-	DPU_DEBUG_CMDENC(cmd_enc, "\n");
 	hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_CMD;
 }
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index fd51fe6..6fc7060 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -539,12 +539,6 @@  static void dpu_encoder_phys_vid_get_hw_resources(
 		struct dpu_encoder_phys *phys_enc,
 		struct dpu_encoder_hw_resources *hw_res)
 {
-	if (!phys_enc || !hw_res) {
-		DPU_ERROR("invalid arg(s), enc %d hw_res %d\n",
-			  phys_enc != 0, hw_res != 0);
-		return;
-	}
-
 	hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_VIDEO;
 }