]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Stop hand rolling drm_crtc_mask()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 9 Jun 2021 08:56:27 +0000 (11:56 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 24 Jun 2021 18:57:30 +0000 (21:57 +0300)
Use drm_crtc_mask() instead of hand rolling it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210609085632.22026-2-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/display/intel_display.c

index db42421867c823839886e544e2bd64938c300b8a..543ea8b3cf17f48a4f1de4a96db04079361bd921 100644 (file)
@@ -6485,7 +6485,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
        struct drm_atomic_state *state = NULL, *restore_state = NULL;
        struct drm_connector_state *connector_state;
        struct intel_crtc_state *crtc_state;
-       int ret, i = -1;
+       int ret;
 
        drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
                    connector->base.id, connector->name,
@@ -6519,8 +6519,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 
        /* Find an unused one (if possible) */
        for_each_crtc(dev, possible_crtc) {
-               i++;
-               if (!(encoder->possible_crtcs & (1 << i)))
+               if (!(encoder->possible_crtcs & drm_crtc_mask(possible_crtc)))
                        continue;
 
                ret = drm_modeset_lock(&possible_crtc->mutex, ctx);