[Intel-gfx] [PATCH 2/3] drm/i915: Make intel_dp_is_edp() less specific

Jesse Barnes jbarnes at virtuousgeek.org
Fri Nov 1 18:25:09 CET 2013


On Fri,  1 Nov 2013 18:22:40 +0200
ville.syrjala at linux.intel.com wrote:

> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> All the bits in the VBT child device type have some speciifc meaning,
> so looking for an exact match isn't always the right thing. On some
> VLVs for example the device type for eDP panels is 0x1806.
> 
> If we mask out the bits that could concievably change between different
> eDP panels, we are left with the set of bits that should still
> tell us if the port is eDP or not.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71051
> Tested-by: Robert Hooker <robert.hooker at canonical.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index ede023c..87cfb12 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3281,7 +3281,7 @@ bool intel_dp_is_edp(struct drm_device *dev, enum port port)
>  		p_child = dev_priv->vbt.child_dev + i;
>  
>  		if (p_child->common.dvo_port == port_mapping[port] &&
> -		    p_child->common.device_type == DEVICE_TYPE_eDP)
> +		    (p_child->common.device_type & 0x1f3f) == (DEVICE_TYPE_eDP & 0x1f3f))
>  			return true;
>  	}
>  	return false;

Is there no way to split out these magic bits individually into
something readable?  If not, I guess we'll have to trust you, but it
seems fragile.

Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the Intel-gfx mailing list