[02/10] drm: Use drm_crtc_mask()
diff mbox

Message ID 20180626194716.12522-2-ville.syrjala@linux.intel.com
State New
Headers show

Commit Message

Ville Syrjälä June 26, 2018, 7:47 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use drm_crtc_mask() where appropriate.

Mostly performed with coccinelle:
@@
@@
- (1<<drm_crtc_index(
+ drm_crtc_mask(
  ...)
-  )

@@
@@
- 1<<drm_crtc_index(
+ drm_crtc_mask(
  ...)

@@
@@
- BIT(drm_crtc_index(
+ drm_crtc_mask(
  ...)
- )

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_crtc.c              | 4 ++--
 drivers/gpu/drm/drm_simple_kms_helper.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Rodrigo Vivi June 26, 2018, 8:11 p.m. UTC | #1
On Tue, Jun 26, 2018 at 10:47:08PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Use drm_crtc_mask() where appropriate.
> 
> Mostly performed with coccinelle:
> @@
> @@
> - (1<<drm_crtc_index(
> + drm_crtc_mask(
>   ...)
> -  )
> 
> @@
> @@
> - 1<<drm_crtc_index(
> + drm_crtc_mask(
>   ...)
> 
> @@
> @@
> - BIT(drm_crtc_index(
> + drm_crtc_mask(
>   ...)
> - )
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/drm_crtc.c              | 4 ++--
>  drivers/gpu/drm/drm_simple_kms_helper.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index f45e7a8d4acd..c762e75a2d94 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -329,9 +329,9 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
>  	crtc->primary = primary;
>  	crtc->cursor = cursor;
>  	if (primary && !primary->possible_crtcs)
> -		primary->possible_crtcs = 1 << drm_crtc_index(crtc);
> +		primary->possible_crtcs = drm_crtc_mask(crtc);
>  	if (cursor && !cursor->possible_crtcs)
> -		cursor->possible_crtcs = 1 << drm_crtc_index(crtc);
> +		cursor->possible_crtcs = drm_crtc_mask(crtc);
>  
>  	ret = drm_crtc_crc_init(crtc);
>  	if (ret) {
> diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
> index 9d87961da1db..b72fcf1e9605 100644
> --- a/drivers/gpu/drm/drm_simple_kms_helper.c
> +++ b/drivers/gpu/drm/drm_simple_kms_helper.c
> @@ -281,7 +281,7 @@ int drm_simple_display_pipe_init(struct drm_device *dev,
>  	if (ret)
>  		return ret;
>  
> -	encoder->possible_crtcs = 1 << drm_crtc_index(crtc);
> +	encoder->possible_crtcs = drm_crtc_mask(crtc);
>  	ret = drm_encoder_init(dev, encoder, &drm_simple_kms_encoder_funcs,
>  			       DRM_MODE_ENCODER_NONE, NULL);
>  	if (ret || !connector)
> -- 
> 2.16.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Patch
diff mbox

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index f45e7a8d4acd..c762e75a2d94 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -329,9 +329,9 @@  int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
 	crtc->primary = primary;
 	crtc->cursor = cursor;
 	if (primary && !primary->possible_crtcs)
-		primary->possible_crtcs = 1 << drm_crtc_index(crtc);
+		primary->possible_crtcs = drm_crtc_mask(crtc);
 	if (cursor && !cursor->possible_crtcs)
-		cursor->possible_crtcs = 1 << drm_crtc_index(crtc);
+		cursor->possible_crtcs = drm_crtc_mask(crtc);
 
 	ret = drm_crtc_crc_init(crtc);
 	if (ret) {
diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
index 9d87961da1db..b72fcf1e9605 100644
--- a/drivers/gpu/drm/drm_simple_kms_helper.c
+++ b/drivers/gpu/drm/drm_simple_kms_helper.c
@@ -281,7 +281,7 @@  int drm_simple_display_pipe_init(struct drm_device *dev,
 	if (ret)
 		return ret;
 
-	encoder->possible_crtcs = 1 << drm_crtc_index(crtc);
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
 	ret = drm_encoder_init(dev, encoder, &drm_simple_kms_encoder_funcs,
 			       DRM_MODE_ENCODER_NONE, NULL);
 	if (ret || !connector)