<div class="gmail_quote">On Thu, Oct 6, 2011 at 8:09 AM, Jesse Barnes <span dir="ltr"><<a href="mailto:jbarnes@virtuousgeek.org">jbarnes@virtuousgeek.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="HOEnZb"><div class="h5">On Wed, 5 Oct 2011 22:45:55 -0700<br>
Simon Que <<a href="mailto:sque@chromium.org">sque@chromium.org</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> Here's a patch to introduce a DMI-based SSC frequency selection in<br>
> intel_bios.c. Instead of always selecting the "alternate" SSC<br>
> frequency as default during initialization, this patch lets some<br>
> systems have the non-alternate frequency by default.<br>
><br>
> Thanks,<br>
> Simon<br>
> =====================================================<br>
> drivers: i915: Select non-alternate SSC frequency for some systems<br>
><br>
> When initializing VBT default values, the alternate BIOS SSC frequency<br>
> is selected. This patch allows the non-alternate frequency to be<br>
> selected as a default, for specified systems. There is a DMI match list<br>
> for systems that are to use the non-alternate frequency. Currently,<br>
> only Lumpy is on the list.<br>
><br>
> Signed-off-by: Simon Que <<a href="mailto:sque@chromium.org">sque@chromium.org</a>><br>
> ---<br>
> drivers/gpu/drm/i915/intel_bios.c | 17 ++++++++++++++++-<br>
> 1 files changed, 16 insertions(+), 1 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/i915/intel_bios.c<br>
> b/drivers/gpu/drm/i915/intel_bios.c<br>
> index 927442a..ec75f15 100644<br>
> --- a/drivers/gpu/drm/i915/intel_bios.c<br>
> +++ b/drivers/gpu/drm/i915/intel_bios.c<br>
> @@ -25,6 +25,7 @@<br>
> *<br>
> */<br>
> #include <drm/drm_dp_helper.h><br>
> +#include <linux/dmi.h><br>
> #include "drmP.h"<br>
> #include "drm.h"<br>
> #include "i915_drm.h"<br>
> @@ -565,6 +566,17 @@ parse_device_mapping(struct drm_i915_private *dev_priv,<br>
> return;<br>
> }<br>
><br>
> +static const struct dmi_system_id lvds_do_not_use_alternate_frequency[] = {<br>
> + {<br>
> + .callback = NULL,<br>
> + .ident = "Lumpy",<br>
> + .matches = {<br>
> + DMI_MATCH(DMI_PRODUCT_NAME, "Lumpy"),<br>
> + }<br>
> + },<br>
> + { }<br>
> +};<br>
> +<br>
> static void<br>
> init_vbt_defaults(struct drm_i915_private *dev_priv)<br>
> {<br>
> @@ -585,7 +597,10 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)<br>
><br>
> /* Default to using SSC */<br>
> dev_priv->lvds_use_ssc = 1;<br>
> - dev_priv->lvds_ssc_freq = intel_bios_ssc_frequency(dev, 1);<br>
> + if (dmi_check_system(lvds_do_not_use_alternate_frequency))<br>
> + dev_priv->lvds_ssc_freq = intel_bios_ssc_frequency(dev, 0);<br>
> + else<br>
> + dev_priv->lvds_ssc_freq = intel_bios_ssc_frequency(dev, 1);<br>
> DRM_DEBUG("Set default to SSC at %dMHz\n", dev_priv->lvds_ssc_freq);<br>
><br>
> /* eDP data */<br>
<br>
</div></div>Do you expect to have other settings that you won't get from a VBIOS VBT<br>
(e.g. video timings, dual refresh info)?<br>
<br>
If so, it might make more sense to have an alternate init path for the<br>
non-VBT values to replace all the VBT parsing. I.e. if your DMI match<br>
happens, call into something other than our init_bios routine to set up<br>
defaults for the platform.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Jesse Barnes, Intel Open Source Technology Center<br>
</font></span></blockquote></div><br><div>Hi Jesse.</div><div><br></div><div>Thanks for the response.</div><div>Let me try to get this thread going again.</div><div><br></div><div>We do expect to have more settings trickle in as we develop new boards, but no additional settings are expected for this board.</div>
<div><br></div><div>Our BIOS boots in two different modes: dev mode which turns on the display and provides VBT to the kernel, and normal mode which does not turn on the screen or provide VBT. When we get VBT from the BIOS, we want to honor it.</div>
<div><br></div><div>When we do not get VBT from BIOS, we want the i915 driver to give us usable settings. Indeed, about a year ago we added init_vbt_defaults() to do this for us.</div><div><br></div><div>Now we want to differentiate these defaults (really just the lvds_ssc_freq setting for now) for different systems, and the proposed solution is to use dmi_check_system() for this.</div>
<div>When our next board comes along, it too may need the "non-alternate" ssc frequency. So making this a list of matches seems to make sense.</div><div><br></div><div>So we still want to call intel_parse_bios(), setup our defaults, then let VBT processing proceed or fail as the case may be.</div>
<div><br></div><div>Thanks,</div><div><br></div><div>bryan.</div>