intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Sharma, Shashank" <shashank.sharma@intel.com>
Cc: daniel.vetter@intel.com, intel-gfx@lists.freedesktop.org,
	akashdeep.sharma@intel.com
Subject: Re: [PATCH 1/7] drm/i915: add lspcon vbt bit parsing
Date: Tue, 22 Mar 2016 19:05:41 +0200	[thread overview]
Message-ID: <20160322170541.GR4329@intel.com> (raw)
In-Reply-To: <56F177D9.5030904@intel.com>

On Tue, Mar 22, 2016 at 10:20:33PM +0530, Sharma, Shashank wrote:
> Thanks for the review, Jani.
> 
> Regards
> Shashank
> 
> On 3/22/2016 9:24 PM, Jani Nikula wrote:
> > On Tue, 22 Mar 2016, Shashank Sharma <shashank.sharma@intel.com> wrote:
> >> LSPCON can be configured on a port using VBT entry.
> >> This patch adds code to parse VBT and detect presence of
> >> LSPCON for a ddi port.
> >>
> >> Signed-off-by: Akashdeep Sharma <akashdeep.sharma@intel.com>
> >> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> >> ---
> >>   drivers/gpu/drm/i915/i915_drv.h       |  1 +
> >>   drivers/gpu/drm/i915/intel_bios.c     | 42 +++++++++++++++++++++++++++++++++++
> >>   drivers/gpu/drm/i915/intel_vbt_defs.h |  1 +
> >>   3 files changed, 44 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> >> index f330a53..cbd40de 100644
> >> --- a/drivers/gpu/drm/i915/i915_drv.h
> >> +++ b/drivers/gpu/drm/i915/i915_drv.h
> >> @@ -3373,6 +3373,7 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv);
> >>   bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin);
> >>   bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
> >>   bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
> >> +bool intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port);
> >>
> >>   /* intel_opregion.c */
> >>   #ifdef CONFIG_ACPI
> >> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> >> index 083003b..a04ab5c 100644
> >> --- a/drivers/gpu/drm/i915/intel_bios.c
> >> +++ b/drivers/gpu/drm/i915/intel_bios.c
> >> @@ -1588,3 +1588,45 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,
> >>
> >>   	return false;
> >>   }
> >> +
> >
> > Please add kernel-doc comment like all the other intel_bios_is_*
> > functions have.
> >
> Ok,
> >> +bool
> >> +intel_bios_is_lspcon_preset(struct drm_device *dev, enum port port)
> >
> > You mean is *present*?
> >
> Well, this is embarrassing :) yes it was supposed to be present.
> > Please pass struct drm_i915_private *dev_priv instead of dev.
> >
> Ok
> >> +{
> >> +	unsigned char i;
> >> +	enum port dvo_port = 0;
> >> +	struct drm_i915_private *dev_priv = dev->dev_private;
> >> +
> >> +	/* LSPCON is supported only for GEN 9 */
> >> +	if (!IS_GEN9(dev))
> >> +		return false;
> >> +
> >> +	/* Check if lspcon is supported in VBT */
> >> +	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
> >> +		if (!dev_priv->vbt.child_dev[i].common.lspcon)
> >
> > I think to be defensive we should also check for bdb version >=
> > 192. That we could check before the loop along with the gen check.
> >
> Yes, this can be done.
> >> +			continue;
> >> +
> >> +		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
> >> +		case DVO_PORT_DPB:
> >> +			dvo_port = PORT_B;
> >> +			break;
> >> +
> >> +		case DVO_PORT_DPC:
> >> +			dvo_port = PORT_C;
> >> +			break;
> >> +
> >> +		case DVO_PORT_DPD:
> >> +			dvo_port = PORT_D;
> >> +			break;
> >> +
> >> +		default:
> >> +			continue;
> >> +		}
> >> +
> >> +		if (dvo_port == port) {
> >> +			DRM_DEBUG_DRIVER("LSPCON configured on port %c\n",
> >> +			port_name(port));
> >> +			return true;
> >> +		}
> >> +	}
> >> +	return false;
> >> +}
> >> diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
> >> index 749dcea..0066b24 100644
> >> --- a/drivers/gpu/drm/i915/intel_vbt_defs.h
> >> +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
> >> @@ -276,6 +276,7 @@ struct common_child_dev_config {
> >>   	u8 flags_1;
> >>   	u8 not_common3[13];
> >>   	u8 iboost_level;
> >> +	u8 lspcon:1;
> >
> > Huh? AFAICT from the spec, lspcon is bit 2 in flags_1. You could define
> > flags_1 in terms of bitfields, including IBOOST_ENABLE.
> >
> I am not sure about this, let me go to VBT spec again, if there is a 
> recent change. Will update you on this.

There was a patch [1] posted recently which added the lspcon bit and others,
and that at least matches the spec at the time when I looked at it (or I
made a mistake). The patch just needs a rebase and it should be good to
go I think, though someone else double checking wouldn't hurt.

[1] https://lists.freedesktop.org/archives/intel-gfx/2016-March/089759.html


> >>   } __packed;
> >
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-03-22 17:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 14:25 [PATCH 0/7] Add lspcon support Shashank Sharma
2016-03-22 14:25 ` [PATCH 1/7] drm/i915: add lspcon vbt bit parsing Shashank Sharma
2016-03-22 15:54   ` Jani Nikula
2016-03-22 16:50     ` Sharma, Shashank
2016-03-22 17:05       ` Ville Syrjälä [this message]
2016-03-22 17:10         ` Sharma, Shashank
2016-03-22 14:25 ` [PATCH 2/7] drm/i915: Add lspcon data structures Shashank Sharma
2016-03-22 14:25 ` [PATCH 3/7] drm/i915: Add new lspcon file Shashank Sharma
2016-03-22 14:25 ` [PATCH 4/7] drm/i915: Add and initialize lspcon connector Shashank Sharma
2016-03-22 14:25 ` [PATCH 5/7] drm/i915: Add and register lspcon connector functions Shashank Sharma
2016-03-22 14:25 ` [PATCH 6/7] drm/i915: Add lspcon core functions Shashank Sharma
2016-03-22 14:25 ` [PATCH 7/7] drm/i915: Add lspcon hpd handler Shashank Sharma
2016-03-22 16:20 ` [PATCH 0/7] Add lspcon support Ville Syrjälä
2016-03-22 16:47   ` Sharma, Shashank
2016-03-23  9:03     ` Daniel Vetter
2016-03-23  9:12       ` Sharma, Shashank
2016-03-25 16:02       ` Sharma, Shashank
2016-03-22 16:32 ` ✗ Fi.CI.BAT: warning 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=20160322170541.GR4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=akashdeep.sharma@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shashank.sharma@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;
as well as URLs for NNTP newsgroup(s).