public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 08/12] drm/i915/vbt: add helper functions to check output support
Date: Tue, 16 Mar 2021 11:18:00 +0200	[thread overview]
Message-ID: <87blbjpid3.fsf@intel.com> (raw)
In-Reply-To: <20210315173238.4bsxk5mwmrnqw6er@ldmartin-desk2>

On Mon, 15 Mar 2021, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> On Wed, Feb 17, 2021 at 09:55:53PM +0200, Jani Nikula wrote:
>>On Wed, 17 Feb 2021, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
>>> On Wed, Feb 17, 2021 at 07:03:38PM +0200, Jani Nikula wrote:
>>>>These will be exposed to the rest of the driver and replace other
>>>>functions. Everything will operate on the child devices.
>>>>
>>>>Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>>>>Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>>>---
>>>> drivers/gpu/drm/i915/display/intel_bios.c | 66 ++++++++++++++++++-----
>>>> 1 file changed, 54 insertions(+), 12 deletions(-)
>>>>
>>>>diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
>>>>index 193772f42582..739ef5d91907 100644
>>>>--- a/drivers/gpu/drm/i915/display/intel_bios.c
>>>>+++ b/drivers/gpu/drm/i915/display/intel_bios.c
>>>>@@ -64,6 +64,7 @@ struct intel_bios_encoder_data {
>>>>
>>>> 	struct child_device_config child;
>>>> 	struct dsc_compression_parameters_entry *dsc;
>>>>+
>>>> 	struct list_head node;
>>>> };
>>>>
>>>>@@ -1761,6 +1762,53 @@ static enum port dvo_port_to_port(struct drm_i915_private *i915,
>>>> 					  dvo_port);
>>>> }
>>>>
>>>>+static void sanitize_device_type(struct intel_bios_encoder_data *devdata,
>>>>+				 enum port port)
>>>>+{
>>>>+	struct drm_i915_private *i915 = devdata->i915;
>>>>+	bool is_hdmi;
>>>>+
>>>>+	if (port != PORT_A || INTEL_GEN(i915) >= 12)
>>>>+		return;
>>>>+
>>>>+	if (!(devdata->child.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING))
>>>>+		return;
>>>>+
>>>>+	is_hdmi = !(devdata->child.device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT);
>>>>+
>>>>+	drm_dbg_kms(&i915->drm, "VBT claims port A supports DVI%s, ignoring\n",
>>>>+		    is_hdmi ? "/HDMI" : "");
>>>>+
>>>>+	devdata->child.device_type &= ~DEVICE_TYPE_TMDS_DVI_SIGNALING;
>>>>+	devdata->child.device_type |= DEVICE_TYPE_NOT_HDMI_OUTPUT;
>>>>+}
>>>>+
>>>>+static bool
>>>>+intel_bios_encoder_supports_dvi(const struct intel_bios_encoder_data *devdata)
>>>>+{
>>>>+	return devdata->child.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;
>>>>+}
>>>>+
>>>>+static bool
>>>>+intel_bios_encoder_supports_hdmi(const struct intel_bios_encoder_data *devdata)
>>>>+{
>>>>+	return intel_bios_encoder_supports_dvi(devdata) &&
>>>>+		(devdata->child.device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
>>>>+}
>>>>+
>>>>+static bool
>>>>+intel_bios_encoder_supports_dp(const struct intel_bios_encoder_data *devdata)
>>>>+{
>>>>+	return devdata->child.device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;
>>>>+}
>>>>+
>>>>+static bool
>>>>+intel_bios_encoder_supports_edp(const struct intel_bios_encoder_data *devdata)
>>>>+{
>>>>+	return intel_bios_encoder_supports_dp(devdata) &&
>>>>+		devdata->child.device_type & DEVICE_TYPE_INTERNAL_CONNECTOR;
>>>>+}
>>>>+
>>>> static void parse_ddi_port(struct drm_i915_private *i915,
>>>> 			   struct intel_bios_encoder_data *devdata)
>>>> {
>>>>@@ -1782,19 +1830,13 @@ static void parse_ddi_port(struct drm_i915_private *i915,
>>>> 		return;
>>>> 	}
>>>>
>>>>-	is_dvi = child->device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;
>>>>-	is_dp = child->device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;
>>>>-	is_crt = child->device_type & DEVICE_TYPE_ANALOG_OUTPUT;
>>>>-	is_hdmi = is_dvi && (child->device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
>>>>-	is_edp = is_dp && (child->device_type & DEVICE_TYPE_INTERNAL_CONNECTOR);
>>>>+	sanitize_device_type(devdata, port);
>>>>
>>>>-	if (port == PORT_A && is_dvi && INTEL_GEN(i915) < 12) {
>>>>-		drm_dbg_kms(&i915->drm,
>>>>-			    "VBT claims port A supports DVI%s, ignoring\n",
>>>>-			    is_hdmi ? "/HDMI" : "");
>>>>-		is_dvi = false;
>>>>-		is_hdmi = false;
>>>>-	}
>>>>+	is_dvi = intel_bios_encoder_supports_dvi(devdata);
>>>>+	is_dp = intel_bios_encoder_supports_dp(devdata);
>>>>+	is_crt = child->device_type & DEVICE_TYPE_ANALOG_OUTPUT;
>>>
>>> any reason to leave this behind?
>>
>>Just logging, even though that doesn't match what we actually do in
>>intel_ddi_crt_present(). I expect there to be further cleanup
>>afterwards.
>
> I mean: you added a intel_bios_encoder_supports_*() for everything else.
> Why not for crt?

I've added it for everything that needs to be made non-static and
available to the rest of the driver. I can add it for completeness if
you like.

BR,
Jani.

>
> Lucas De Marchi
>
>>
>>BR,
>>Jani.
>>
>>>
>>> Lucas De Marchi
>>>
>>>>+	is_hdmi = intel_bios_encoder_supports_hdmi(devdata);
>>>>+	is_edp = intel_bios_encoder_supports_edp(devdata);
>>>>
>>>> 	info->supports_dvi = is_dvi;
>>>> 	info->supports_hdmi = is_hdmi;
>>>>--
>>>>2.20.1
>>>>
>>
>>-- 
>>Jani Nikula, Intel Open Source Graphics Center
>>_______________________________________________
>>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

  reply	other threads:[~2021-03-16  9:18 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 17:03 [Intel-gfx] [PATCH 00/12] drm/i915/bios: vbt child device rework Jani Nikula
2021-02-17 17:03 ` [Intel-gfx] [PATCH 01/12] drm/i915/bios: mass convert dev_priv to i915 Jani Nikula
2021-02-22 18:14   ` Ville Syrjälä
2021-02-17 17:03 ` [Intel-gfx] [PATCH 02/12] drm/i915/bios: store bdb version in i915 Jani Nikula
2021-02-22 18:14   ` Ville Syrjälä
2021-02-17 17:03 ` [Intel-gfx] [PATCH 03/12] drm/i915/bios: limit default outputs by platform on missing VBT Jani Nikula
2021-02-22 18:16   ` Ville Syrjälä
2021-02-17 17:03 ` [Intel-gfx] [PATCH 04/12] drm/i915/bios: limit default outputs to ports A through F Jani Nikula
2021-02-17 17:23   ` Lucas De Marchi
2021-02-17 17:28     ` Lucas De Marchi
2021-02-17 19:49       ` Jani Nikula
2021-02-17 19:58         ` Lucas De Marchi
2021-02-23 13:34           ` Jani Nikula
2021-02-24  0:34             ` Lucas De Marchi
2021-02-17 17:03 ` [Intel-gfx] [PATCH 05/12] drm/i915/bios: create fake child devices on missing VBT Jani Nikula
2021-03-09  0:51   ` Lucas De Marchi
2021-02-17 17:03 ` [Intel-gfx] [PATCH 06/12] drm/i915/bios: rename display_device_data to intel_bios_encoder_data Jani Nikula
2021-02-17 17:44   ` Lucas De Marchi
2021-02-17 19:52     ` Jani Nikula
2021-02-23 12:50       ` Jani Nikula
2021-02-24  0:37         ` Lucas De Marchi
2021-02-17 17:03 ` [Intel-gfx] [PATCH 07/12] drm/i915/bios: add i915 backpointer " Jani Nikula
2021-02-17 17:03 ` [Intel-gfx] [PATCH 08/12] drm/i915/vbt: add helper functions to check output support Jani Nikula
2021-02-17 17:46   ` Lucas De Marchi
2021-02-17 19:55     ` Jani Nikula
2021-03-15 17:32       ` Lucas De Marchi
2021-03-16  9:18         ` Jani Nikula [this message]
2021-02-17 17:03 ` [Intel-gfx] [PATCH 09/12] drm/i915/bios: save a higher level pointer in ddi_vbt_port_info[] Jani Nikula
2021-03-15 17:36   ` Lucas De Marchi
2021-02-17 17:03 ` [Intel-gfx] [PATCH 10/12] drm/i915/bios: start using the intel_bios_encoder_data directly Jani Nikula
2021-03-15 17:41   ` Lucas De Marchi
2021-02-17 17:03 ` [Intel-gfx] [PATCH 11/12] drm/i915/bios: start using intel_bios_encoder_data for Type-C USB and TBT Jani Nikula
2021-03-15 17:49   ` Lucas De Marchi
2021-02-17 17:03 ` [Intel-gfx] [PATCH 12/12] drm/i915/bios: add intel_bios_encoder_data to encoder, use for iboost Jani Nikula
2021-03-15 17:52   ` Lucas De Marchi
2021-02-17 17:20 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: vbt child device rework Patchwork
2021-02-17 17:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-02-17 17:54 ` [Intel-gfx] [PATCH 00/12] " Lucas De Marchi
2021-02-17 19:57   ` Jani Nikula
2021-02-17 20:52 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork

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=87blbjpid3.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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