diff mbox series

[2/3] drm/rockchip: remove NR_LAYERS macro on vop2

Message ID 20231012023630.1497499-1-andyshrk@163.com (mailing list archive)
State New, archived
Headers show
Series Some cleanup of vop2 driver | expand

Commit Message

Andy Yan Oct. 12, 2023, 2:36 a.m. UTC
From: Andy Yan <andy.yan@rock-chips.com>

There are 8 layers on rk3588, so a fix defined macro is
not appropriate.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
---

 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Sascha Hauer Oct. 13, 2023, 6:11 a.m. UTC | #1
On Thu, Oct 12, 2023 at 10:36:30AM +0800, Andy Yan wrote:
> From: Andy Yan <andy.yan@rock-chips.com>
> 
> There are 8 layers on rk3588, so a fix defined macro is
> not appropriate.
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> ---
> 
>  drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha

> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index 3c524ca23d53..57c05c6b246c 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -2251,8 +2251,6 @@ static struct vop2_video_port *find_vp_without_primary(struct vop2 *vop2)
>  	return NULL;
>  }
>  
> -#define NR_LAYERS 6
> -
>  static int vop2_create_crtcs(struct vop2 *vop2)
>  {
>  	const struct vop2_data *vop2_data = vop2->data;
> @@ -2371,7 +2369,7 @@ static int vop2_create_crtcs(struct vop2 *vop2)
>  		struct vop2_video_port *vp = &vop2->vps[i];
>  
>  		if (vp->crtc.port)
> -			vp->nlayers = NR_LAYERS / nvps;
> +			vp->nlayers = vop2_data->win_size / nvps;
>  	}
>  
>  	return 0;
> -- 
> 2.34.1
> 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index 3c524ca23d53..57c05c6b246c 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -2251,8 +2251,6 @@  static struct vop2_video_port *find_vp_without_primary(struct vop2 *vop2)
 	return NULL;
 }
 
-#define NR_LAYERS 6
-
 static int vop2_create_crtcs(struct vop2 *vop2)
 {
 	const struct vop2_data *vop2_data = vop2->data;
@@ -2371,7 +2369,7 @@  static int vop2_create_crtcs(struct vop2 *vop2)
 		struct vop2_video_port *vp = &vop2->vps[i];
 
 		if (vp->crtc.port)
-			vp->nlayers = NR_LAYERS / nvps;
+			vp->nlayers = vop2_data->win_size / nvps;
 	}
 
 	return 0;