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@xxxxxxxxx> wrote: > > From: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx> > > > > 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@xxxxxxxxx> > > --- > > 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 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx