[PATCH 11/11] drm/mediatek: Rename "pending_needs_vblank" to "needs_vblank"

Shawn Sung posted 11 patches 8 months, 2 weeks ago
There is a newer version of this series
[PATCH 11/11] drm/mediatek: Rename "pending_needs_vblank" to "needs_vblank"
Posted by Shawn Sung 8 months, 2 weeks ago
From: Hsiao Chien Sung <shawn.sung@mediatek.corp-partner.google.com>

Rename "pending_needs_vblank" to "needs_vblank" to reduce the code size.

Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.corp-partner.google.com>
---
 drivers/gpu/drm/mediatek/mtk_crtc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c b/drivers/gpu/drm/mediatek/mtk_crtc.c
index 7fe234de83a3..a1fb6c67681d 100644
--- a/drivers/gpu/drm/mediatek/mtk_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_crtc.c
@@ -42,7 +42,7 @@ struct mtk_crtc {
 	struct drm_crtc			base;
 	bool				enabled;
 
-	bool				pending_needs_vblank;
+	bool				needs_vblank;
 	struct drm_pending_vblank_event	*event;
 
 	struct drm_plane		*planes;
@@ -105,9 +105,9 @@ static void mtk_crtc_finish_page_flip(struct mtk_crtc *mtk_crtc)
 static void mtk_drm_finish_page_flip(struct mtk_crtc *mtk_crtc)
 {
 	drm_crtc_handle_vblank(&mtk_crtc->base);
-	if (!mtk_crtc->config_updating && mtk_crtc->pending_needs_vblank) {
+	if (!mtk_crtc->config_updating && mtk_crtc->needs_vblank) {
 		mtk_crtc_finish_page_flip(mtk_crtc);
-		mtk_crtc->pending_needs_vblank = false;
+		mtk_crtc->needs_vblank = false;
 	}
 }
 
@@ -571,7 +571,7 @@ static void mtk_crtc_update_config(struct mtk_crtc *mtk_crtc, bool needs_vblank)
 	mutex_lock(&mtk_crtc->hw_lock);
 	mtk_crtc->config_updating = true;
 	if (needs_vblank)
-		mtk_crtc->pending_needs_vblank = true;
+		mtk_crtc->needs_vblank = true;
 
 	for (i = 0; i < mtk_crtc->layer_nr; i++) {
 		struct drm_plane *plane = &mtk_crtc->planes[i];
-- 
2.18.0
Re: [PATCH 11/11] drm/mediatek: Rename "pending_needs_vblank" to "needs_vblank"
Posted by CK Hu (胡俊光) 8 months ago
Hi, Shawn:

On Mon, 2024-02-26 at 16:50 +0800, Shawn Sung wrote:
> From: Hsiao Chien Sung <shawn.sung@mediatek.corp-partner.google.com>
> 
> Rename "pending_needs_vblank" to "needs_vblank" to reduce the code
> size.

In mtk crtc, many variable has prefix 'pending' to indicate something
has not been done yet. To align this naming, I think it's better to
keep this prefix.

Regards,
CK

> 
> Signed-off-by: Hsiao Chien Sung <
> shawn.sung@mediatek.corp-partner.google.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_crtc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c
> b/drivers/gpu/drm/mediatek/mtk_crtc.c
> index 7fe234de83a3..a1fb6c67681d 100644
> --- a/drivers/gpu/drm/mediatek/mtk_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_crtc.c
> @@ -42,7 +42,7 @@ struct mtk_crtc {
>  	struct drm_crtc			base;
>  	bool				enabled;
>  
> -	bool				pending_needs_vblank;
> +	bool				needs_vblank;
>  	struct drm_pending_vblank_event	*event;
>  
>  	struct drm_plane		*planes;
> @@ -105,9 +105,9 @@ static void mtk_crtc_finish_page_flip(struct
> mtk_crtc *mtk_crtc)
>  static void mtk_drm_finish_page_flip(struct mtk_crtc *mtk_crtc)
>  {
>  	drm_crtc_handle_vblank(&mtk_crtc->base);
> -	if (!mtk_crtc->config_updating && mtk_crtc-
> >pending_needs_vblank) {
> +	if (!mtk_crtc->config_updating && mtk_crtc->needs_vblank) {
>  		mtk_crtc_finish_page_flip(mtk_crtc);
> -		mtk_crtc->pending_needs_vblank = false;
> +		mtk_crtc->needs_vblank = false;
>  	}
>  }
>  
> @@ -571,7 +571,7 @@ static void mtk_crtc_update_config(struct
> mtk_crtc *mtk_crtc, bool needs_vblank)
>  	mutex_lock(&mtk_crtc->hw_lock);
>  	mtk_crtc->config_updating = true;
>  	if (needs_vblank)
> -		mtk_crtc->pending_needs_vblank = true;
> +		mtk_crtc->needs_vblank = true;
>  
>  	for (i = 0; i < mtk_crtc->layer_nr; i++) {
>  		struct drm_plane *plane = &mtk_crtc->planes[i];
Re: [PATCH 11/11] drm/mediatek: Rename "pending_needs_vblank" to "needs_vblank"
Posted by AngeloGioacchino Del Regno 8 months, 2 weeks ago
Il 26/02/24 09:50, Shawn Sung ha scritto:
> From: Hsiao Chien Sung <shawn.sung@mediatek.corp-partner.google.com>
> 
> Rename "pending_needs_vblank" to "needs_vblank" to reduce the code size.
> 

This decreases human readability though, so I would prefer that we omit this one.

Regards,
Angelo

> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.corp-partner.google.com>
> ---
>   drivers/gpu/drm/mediatek/mtk_crtc.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c b/drivers/gpu/drm/mediatek/mtk_crtc.c
> index 7fe234de83a3..a1fb6c67681d 100644
> --- a/drivers/gpu/drm/mediatek/mtk_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_crtc.c
> @@ -42,7 +42,7 @@ struct mtk_crtc {
>   	struct drm_crtc			base;
>   	bool				enabled;
>   
> -	bool				pending_needs_vblank;
> +	bool				needs_vblank;
>   	struct drm_pending_vblank_event	*event;
>   
>   	struct drm_plane		*planes;
> @@ -105,9 +105,9 @@ static void mtk_crtc_finish_page_flip(struct mtk_crtc *mtk_crtc)
>   static void mtk_drm_finish_page_flip(struct mtk_crtc *mtk_crtc)
>   {
>   	drm_crtc_handle_vblank(&mtk_crtc->base);
> -	if (!mtk_crtc->config_updating && mtk_crtc->pending_needs_vblank) {
> +	if (!mtk_crtc->config_updating && mtk_crtc->needs_vblank) {
>   		mtk_crtc_finish_page_flip(mtk_crtc);
> -		mtk_crtc->pending_needs_vblank = false;
> +		mtk_crtc->needs_vblank = false;
>   	}
>   }
>   
> @@ -571,7 +571,7 @@ static void mtk_crtc_update_config(struct mtk_crtc *mtk_crtc, bool needs_vblank)
>   	mutex_lock(&mtk_crtc->hw_lock);
>   	mtk_crtc->config_updating = true;
>   	if (needs_vblank)
> -		mtk_crtc->pending_needs_vblank = true;
> +		mtk_crtc->needs_vblank = true;
>   
>   	for (i = 0; i < mtk_crtc->layer_nr; i++) {
>   		struct drm_plane *plane = &mtk_crtc->planes[i];
Re: [PATCH 11/11] drm/mediatek: Rename "pending_needs_vblank" to "needs_vblank"
Posted by Shawn Sung (宋孝謙) 8 months, 2 weeks ago
Hi Angelo,

On Mon, 2024-02-26 at 13:39 +0100, AngeloGioacchino Del Regno wrote:
> Il 26/02/24 09:50, Shawn Sung ha scritto:
> > From: Hsiao Chien Sung <shawn.sung@mediatek.corp-partner.google.com
> > >
> > 
> > Rename "pending_needs_vblank" to "needs_vblank" to reduce the code
> > size.
> > 
> 
> This decreases human readability though, so I would prefer that we
> omit this one.
> 

Got it. Will check if this patch should be omitted.

Thanks,
Shawn