public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
	Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 2/2] drm/i915: use the HDMI DDI buffer translations from VBT
Date: Tue, 3 Sep 2013 18:01:58 +0200	[thread overview]
Message-ID: <20130903160158.GJ5767@phenom.ffwll.local> (raw)
In-Reply-To: <CABVU7+tYfFCCRcch=-yUVrwNhGm1zR3KKgkz7y8z9azy0DjQgA@mail.gmail.com>

On Tue, Sep 03, 2013 at 11:37:27AM -0300, Rodrigo Vivi wrote:
> On Wed, Aug 28, 2013 at 12:39 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> >
> > We currently use the recommended values from BSpec, but the VBT
> > specifies the correct value to use for the hardware we have, so use
> > it. We also fall back to the recommended value in case we can't find
> > the VBT.
> >
> > In addition, this code also provides some infrastructure to parse more
> > information about the DDI ports. There's a lot more information we
> > could extract and use in the future.
> >
> > v2: - Move some code to init_vbt_defaults.
> >
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h   |  6 ++++
> >  drivers/gpu/drm/i915/intel_bios.c | 69 +++++++++++++++++++++++++++++++++++++++
> >  drivers/gpu/drm/i915/intel_ddi.c  | 24 ++++++++++++--
> >  3 files changed, 97 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 08fe1b6..645dd74 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1039,6 +1039,10 @@ enum modeset_restore {
> >         MODESET_SUSPENDED,
> >  };
> >
> > +struct ddi_vbt_port_info {
> > +       uint8_t hdmi_level_shift;
> > +};
> > +
> >  struct intel_vbt_data {
> >         struct drm_display_mode *lfp_lvds_vbt_mode; /* if any */
> >         struct drm_display_mode *sdvo_lvds_vbt_mode; /* if any */
> > @@ -1068,6 +1072,8 @@ struct intel_vbt_data {
> >
> >         int child_dev_num;
> >         union child_device_config *child_dev;
> > +
> > +       struct ddi_vbt_port_info ddi_port_info[5];
> >  };
> >
> >  enum intel_ddb_partitioning {
> > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> > index 8a27925..79bb651 100644
> > --- a/drivers/gpu/drm/i915/intel_bios.c
> > +++ b/drivers/gpu/drm/i915/intel_bios.c
> > @@ -568,6 +568,63 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
> >         }
> >  }
> >
> > +static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
> > +                          struct bdb_header *bdb)
> > +{
> > +       union child_device_config *it, *child = NULL;
> > +       struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
> > +       uint8_t hdmi_level_shift;
> > +       int i, j;
> > +       int dvo_ports[][2] = {
> > +               {0, 10}, {1, 7}, {2, 8}, {3, 9}, {6, /* Unused */ 0},
> > +       };
> > +       int n_dvo_ports[] = {2, 2, 2, 2, 1};
> 
> I hadn't get this until you explain on irc, but I have no better idea
> how to make it more clear, so just ignore me ;)

If you use -1 for the unused slot (and check for that value in the loop)
you could ditch the n_dvo_ports array.  Also I think the magic values in
dvo_ports need a comment or so ...
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-09-03 16:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-27 20:22 [PATCH 1/2] drm/i915: VBT's child_device_config changes over time Paulo Zanoni
2013-08-27 20:22 ` [PATCH 2/2] drm/i915: use the HDMI DDI buffer translations from VBT Paulo Zanoni
2013-08-28 15:39   ` Paulo Zanoni
2013-09-03 14:37     ` Rodrigo Vivi
2013-09-03 16:01       ` Daniel Vetter [this message]
2013-09-11 20:34       ` Paulo Zanoni
2013-09-03 14:33 ` [PATCH 1/2] drm/i915: VBT's child_device_config changes over time 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=20130903160158.GJ5767@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=rodrigo.vivi@gmail.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