From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
intel-gfx@lists.freedesktop.org, daniel.vetter@intel.com
Cc: akashdeep.sharma@intel.com
Subject: Re: [PATCH 1/7] drm/i915: add lspcon vbt bit parsing
Date: Tue, 22 Mar 2016 22:20:33 +0530 [thread overview]
Message-ID: <56F177D9.5030904@intel.com> (raw)
In-Reply-To: <87vb4e1pb8.fsf@intel.com>
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.
>> } __packed;
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-03-22 16:50 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 [this message]
2016-03-22 17:05 ` Ville Syrjälä
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=56F177D9.5030904@intel.com \
--to=shashank.sharma@intel.com \
--cc=akashdeep.sharma@intel.com \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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;
as well as URLs for NNTP newsgroup(s).