From: Jani Nikula <jani.nikula@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/5] drm/i915/crt: split out intel_crt_present() to platform specific setup
Date: Tue, 22 Jan 2019 10:26:59 +0200 [thread overview]
Message-ID: <87h8e13xnw.fsf@intel.com> (raw)
In-Reply-To: <20190121193017.GQ20097@intel.com>
On Mon, 21 Jan 2019, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Mon, Jan 21, 2019 at 04:21:30PM +0200, Jani Nikula wrote:
>> With new platforms not having CRT support and most conditions in
>> intel_crt_present() being specific to DDI, split out the CRT
>> initialization to platform specific blocks in the if ladder. Add new
>> Pineview block for this.
>>
>> This puts intel_crt_init() more in line with the rest of the outputs,
>> and makes it slightly easier for the uninitiated to figure out which
>> platforms actually have what.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/i915/intel_display.c | 37 ++++++++++++++++++----------
>> 1 file changed, 24 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 2fa9f4aec08e..e8bc297c60ab 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -14245,23 +14245,17 @@ static bool has_edp_a(struct drm_i915_private *dev_priv)
>> return true;
>> }
>>
>> -static bool intel_crt_present(struct drm_i915_private *dev_priv)
>> +static bool intel_ddi_crt_present(struct drm_i915_private *dev_priv)
>> {
>> - if (INTEL_GEN(dev_priv) >= 9)
>> - return false;
>
> We should probably keep this in case the vbt is bonkers.
Oh, definitely, thanks for spotting!
>
>> -
>> if (IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv))
>> return false;
>>
>> - if (IS_CHERRYVIEW(dev_priv))
>> - return false;
>> -
>> if (HAS_PCH_LPT_H(dev_priv) &&
>> I915_READ(SFUSE_STRAP) & SFUSE_STRAP_CRT_DISABLED)
>> return false;
>>
>> /* DDI E can't be used if DDI A requires 4 lanes */
>> - if (HAS_DDI(dev_priv) && I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
>> + if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
>> return false;
>>
>> if (!dev_priv->vbt.int_crt_support)
>> @@ -14323,9 +14317,6 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>> */
>> intel_lvds_init(dev_priv);
>>
>> - if (intel_crt_present(dev_priv))
>> - intel_crt_init(dev_priv);
>> -
>> if (IS_ICELAKE(dev_priv)) {
>> intel_ddi_init(dev_priv, PORT_A);
>> intel_ddi_init(dev_priv, PORT_B);
>> @@ -14354,6 +14345,9 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>> } else if (HAS_DDI(dev_priv)) {
>> int found;
>>
>> + if (intel_ddi_crt_present(dev_priv))
>> + intel_crt_init(dev_priv);
>> +
>> /*
>> * Haswell uses DDI functions to detect digital outputs.
>> * On SKL pre-D0 the strap isn't connected, so we assume
>> @@ -14385,6 +14379,10 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>>
>> } else if (HAS_PCH_SPLIT(dev_priv)) {
>> int found;
>> +
>> + if (dev_priv->vbt.int_crt_support)
>> + intel_crt_init(dev_priv);
>> +
>> dpd_is_edp = intel_dp_is_port_edp(dev_priv, PORT_D);
>>
>> if (has_edp_a(dev_priv))
>> @@ -14413,6 +14411,9 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>> } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
>> bool has_edp, has_port;
>>
>> + if (IS_VALLEYVIEW(dev_priv) && dev_priv->vbt.int_crt_support)
>> + intel_crt_init(dev_priv);
>> +
>> /*
>> * The DP_DETECTED bit is the latched state of the DDC
>> * SDA pin at boot. However since eDP doesn't require DDC
>> @@ -14455,9 +14456,15 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>> }
>>
>> vlv_dsi_init(dev_priv);
>> - } else if (!IS_GEN(dev_priv, 2) && !IS_PINEVIEW(dev_priv)) {
>> + } else if (IS_PINEVIEW(dev_priv)) {
>> + if (dev_priv->vbt.int_crt_support)
>> + intel_crt_init(dev_priv);
>> + } else if (IS_GEN_RANGE(dev_priv, 3, 4)) {
>> bool found = false;
>>
>> + if (dev_priv->vbt.int_crt_support)
>> + intel_crt_init(dev_priv);
>> +
>> if (I915_READ(GEN3_SDVOB) & SDVO_DETECTED) {
>> DRM_DEBUG_KMS("probing SDVOB\n");
>> found = intel_sdvo_init(dev_priv, GEN3_SDVOB, PORT_B);
>> @@ -14489,8 +14496,12 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>>
>> if (IS_G4X(dev_priv) && (I915_READ(DP_D) & DP_DETECTED))
>> intel_dp_init(dev_priv, DP_D, PORT_D);
>> - } else if (IS_GEN(dev_priv, 2))
>> + } else if (IS_GEN(dev_priv, 2)) {
>> + if (dev_priv->vbt.int_crt_support)
>> + intel_crt_init(dev_priv);
>
> int_crt_support is always true for pre-vlv/pre-hsw so we could
> skip the check in most of these cases. Either way is fine by me.
I added that change as a separate patch on top.
>
> With the gen9 stuff sorted this is
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Thanks for the reviews, new series on the list.
BR,
Jani.
>
>> +
>> intel_dvo_init(dev_priv);
>> + }
>>
>> if (SUPPORTS_TV(dev_priv))
>> intel_tv_init(dev_priv);
>> --
>> 2.20.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2019-01-22 8:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-21 14:21 [PATCH 1/5] drm/i915/crt: split out intel_crt_present() to platform specific setup Jani Nikula
2019-01-21 14:21 ` [PATCH 2/5] drm/i915/lvds: only call intel_lvds_init() on platforms that might have LVDS Jani Nikula
2019-01-21 19:30 ` Ville Syrjälä
2019-01-21 14:21 ` [PATCH 3/5] drm/i915/lvds: nuke intel_lvds_supported() Jani Nikula
2019-01-21 19:31 ` Ville Syrjälä
2019-01-22 8:23 ` Jani Nikula
2019-01-21 14:21 ` [PATCH 4/5] drm/i915/tv: only call intel_tv_init() on platforms that might have TV Jani Nikula
2019-01-21 19:33 ` Ville Syrjälä
2019-01-22 8:25 ` Jani Nikula
2019-01-21 14:21 ` [PATCH 5/5] drm/i915: rename has_edp_a() to intel_pch_has_edp_a() Jani Nikula
2019-01-21 19:36 ` Ville Syrjälä
2019-01-21 15:39 ` ✓ Fi.CI.BAT: success for series starting with [1/5] drm/i915/crt: split out intel_crt_present() to platform specific setup Patchwork
2019-01-21 19:03 ` ✓ Fi.CI.IGT: " Patchwork
2019-01-21 19:30 ` [PATCH 1/5] " Ville Syrjälä
2019-01-22 8:26 ` Jani Nikula [this message]
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=87h8e13xnw.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox