[Intel-gfx] [PATCH v2] drm/i915/dsi: skip gpio element execution when not supported

Jani Nikula jani.nikula at intel.com
Thu Feb 4 17:22:30 UTC 2016


On Thu, 04 Feb 2016, Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:
> On Thu, Feb 04, 2016 at 07:10:42PM +0200, Jani Nikula wrote:
>> On Thu, 04 Feb 2016, Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:
>> > On Thu, Feb 04, 2016 at 06:52:47PM +0200, Jani Nikula wrote:
>> >> Skip v3 gpio element because the support is not there, and skip gpio
>> >> element on non-vlv because the sideband code is vlv specific.
>> >> 
>> >> v2: the gpio stuff is currently only supported on vlv (Ville)
>> >> 
>> >> Cc: drm-intel-fixes at lists.freedesktop.org
>> >> Fixes: 2a33d93486f2 ("drm/i915/bios: add support for MIPI sequence block v3")
>> >> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>> >> ---
>> >>  drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 13 +++++++++++++
>> >>  1 file changed, 13 insertions(+)
>> >> 
>> >> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> >> index f4d303ee538b..bcc083db7632 100644
>> >> --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> >> +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
>> >> @@ -205,6 +205,9 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>> >>  	struct drm_device *dev = intel_dsi->base.base.dev;
>> >>  	struct drm_i915_private *dev_priv = dev->dev_private;
>> >>  
>> >> +	if (dev_priv->vbt.dsi.seq_version >= 3)
>> >> +		data++;
>> >> +
>> >
>> > So here we handle v3
>> >
>> >>  	gpio = *data++;
>> >>  
>> >>  	/* pull up/down */
>> >> @@ -215,6 +218,16 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
>> >>  		goto out;
>> >>  	}
>> >>  
>> >> +	if (!IS_VALLEYVIEW(dev_priv)) {
>> >> +		DRM_DEBUG_KMS("GPIO element not supported on this platform\n");
>> >> +		goto out;
>> >> +	}
>> >> +
>> >> +	if (dev_priv->vbt.dsi.seq_version >= 3) {
>> >> +		DRM_DEBUG_KMS("GPIO element v3 not supported\n");
>> >> +		goto out;
>> >> +	}
>> >
>> > but here we say it's not supported. Is there more missing?
>> 
>> The whole point of doing it this way is to support *skipping* v3 in a
>> graceful manner. If I bailed out at the top, I'd have to duplicate the
>> knowledge about the length of the element.
>
> Hmm, right. But the question still stands; what more is missing for
> actual v3 support?

That's the ugly patch #8...?

> From what I saw in the spec, the new byte is there just for Windows.
> Which in itself is an utter fail on part of the spec. There's no good
> reason why Windows and Linux should do things differently because that
> will probably mean putting Linux on some random machine that came with
> Windows won't work :(

There's no disagreement here. Ugly specs lead to ugly implementations.

BR,
Jani.



-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list