drm: Use drm_crtc_mask()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 26 Jun 2018 19:47:08 +0000 (22:47 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 2 Jul 2018 15:45:55 +0000 (18:45 +0300)
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>
Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-2-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_simple_kms_helper.c

index f45e7a8d4acd61486e40091ac5cca45b6abbd095..c762e75a2d94ef5cc1b1349d6c0c51a496dadca5 100644 (file)
@@ -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) {
index 9d87961da1dbccf759facd7926d453dac21d1ddf..b72fcf1e9605c6bca189019c7f06ed24ef3a2104 100644 (file)
@@ -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)