From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/i915: digital_port_connected sort platforms newer-to-older
Date: Fri, 19 Oct 2018 22:50:01 +0300 [thread overview]
Message-ID: <20181019195001.GB9144@intel.com> (raw)
In-Reply-To: <20181019190335.26616-4-rodrigo.vivi@intel.com>
On Fri, Oct 19, 2018 at 12:03:33PM -0700, Rodrigo Vivi wrote:
> Just sorting this "if" block from newer to older platform.
>
> The main difference here is the addition of a
> missing case with return false that should never occur.
> And if it occurs it is better than to raise a warn
> than use the icl one.
>
> The gen >= 11 was already present in the previous logic,
> although hidden.
>
> So, in summary no real functional change.
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 27 +++++++++++++++------------
> 1 file changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 3384a9bbdafd..8c38efef77a1 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5035,20 +5035,23 @@ bool intel_digital_port_connected(struct intel_encoder *encoder)
> return g4x_digital_port_connected(encoder);
> }
>
> - if (IS_GEN5(dev_priv))
> - return ilk_digital_port_connected(encoder);
> - else if (IS_GEN6(dev_priv))
> - return snb_digital_port_connected(encoder);
> - else if (IS_GEN7(dev_priv))
> - return ivb_digital_port_connected(encoder);
> - else if (IS_GEN8(dev_priv))
> - return bdw_digital_port_connected(encoder);
> + if (INTEL_GEN(dev_priv) >= 11)
> + return icl_digital_port_connected(encoder);
> + else if (IS_GEN10(dev_priv) || IS_GEN9_BC(dev_priv))
> + return spt_digital_port_connected(encoder);
> else if (IS_GEN9_LP(dev_priv))
> return bxt_digital_port_connected(encoder);
Tough choice here between skl+/cnl vs. bxt/glk. I guess this
is pretty much as good as the other order.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Might also be good vfunc territory here. If we made it per-encoder
we could even remove the port A special cases from these. At the
cost of some extra function pointers in our structs.
> - else if (IS_GEN9_BC(dev_priv) || IS_GEN10(dev_priv))
> - return spt_digital_port_connected(encoder);
> - else
> - return icl_digital_port_connected(encoder);
> + else if (IS_GEN8(dev_priv))
> + return bdw_digital_port_connected(encoder);
> + else if (IS_GEN7(dev_priv))
> + return ivb_digital_port_connected(encoder);
> + else if (IS_GEN6(dev_priv))
> + return snb_digital_port_connected(encoder);
> + else if (IS_GEN5(dev_priv))
> + return ilk_digital_port_connected(encoder);
> +
> + MISSING_CASE(INTEL_GEN(dev_priv));
> + return false;
> }
>
> static struct edid *
> --
> 2.19.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-10-19 19:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-19 19:03 [PATCH 0/5] Sorting "if" blocks and statements from newer to older platform Rodrigo Vivi
2018-10-19 19:03 ` [PATCH 1/5] drm/i915: ddi_clock_get sort platforms newer-to-older Rodrigo Vivi
2018-10-19 19:43 ` Ville Syrjälä
2018-10-19 19:03 ` [PATCH 2/5] drm/i915: compute_min_voltage_level " Rodrigo Vivi
2018-10-19 19:43 ` Ville Syrjälä
2018-10-19 19:03 ` [PATCH 3/5] drm/i915: digital_port_connected " Rodrigo Vivi
2018-10-19 19:50 ` Ville Syrjälä [this message]
2018-10-19 19:03 ` [PATCH 4/5] drm/i915: power_domains_init " Rodrigo Vivi
2018-10-19 19:55 ` Ville Syrjälä
2018-10-19 19:03 ` [PATCH 5/5] drm/i915: uncore_fw_domains_init " Rodrigo Vivi
2018-10-19 19:56 ` Ville Syrjälä
2018-10-22 14:05 ` ✗ Fi.CI.BAT: failure for Sorting "if" blocks and statements from newer to older platform Patchwork
-- strict thread matches above, loose matches on Subject: below --
2018-10-22 17:15 [PATCH 1/5] drm/i915: ddi_clock_get sort platforms newer-to-older Rodrigo Vivi
2018-10-22 17:15 ` [PATCH 3/5] drm/i915: digital_port_connected " Rodrigo Vivi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181019195001.GB9144@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.