[Intel-gfx] [PATCH 11/16] drm/i915: Refactor get_other_active_crtc()

Paulo Zanoni przanoni at gmail.com
Wed Jun 4 18:59:16 CEST 2014


2014-05-22 11:48 GMT-03:00  <ville.syrjala at linux.intel.com>:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Pull the code to locate the other active crtc out from
> haswell_mode_set_planes_workaround() into a separate function.
> This will have another use later.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 33 +++++++++++++++++++++------------
>  1 file changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index ca362db..bccf414 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3965,6 +3965,26 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc)
>         drm_vblank_off(dev, pipe);
>  }
>
> +static struct intel_crtc *get_other_active_crtc(struct intel_crtc *crtc)
> +{
> +       struct drm_device *dev = crtc->base.dev;
> +       struct intel_crtc *crtc_it, *other_active_crtc = NULL;
> +
> +       /* We want to get the other_active_crtc only if there's only 1 other
> +        * active crtc. */
> +       for_each_intel_crtc(dev, crtc_it) {
> +               if (!crtc_it->active || crtc_it == crtc)
> +                       continue;
> +
> +               if (other_active_crtc)
> +                       return NULL;
> +
> +               other_active_crtc = crtc_it;
> +       }
> +
> +       return other_active_crtc;
> +}
> +
>  static void ironlake_crtc_enable(struct drm_crtc *crtc)
>  {
>         struct drm_device *dev = crtc->dev;
> @@ -4057,19 +4077,8 @@ static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
>  static void haswell_mode_set_planes_workaround(struct intel_crtc *crtc)
>  {
>         struct drm_device *dev = crtc->base.dev;
> -       struct intel_crtc *crtc_it, *other_active_crtc = NULL;
> -
> -       /* We want to get the other_active_crtc only if there's only 1 other
> -        * active crtc. */
> -       for_each_intel_crtc(dev, crtc_it) {
> -               if (!crtc_it->active || crtc_it == crtc)
> -                       continue;
> +       struct intel_crtc *other_active_crtc = get_other_active_crtc(crtc);
>
> -               if (other_active_crtc)
> -                       return;
> -
> -               other_active_crtc = crtc_it;
> -       }
>         if (!other_active_crtc)
>                 return;
>
> --
> 1.8.5.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni



More information about the Intel-gfx mailing list