[Intel-gfx] [PATCH v2 2/2] drm/i915: Make intel_dp_is_edp() less specific
Paulo Zanoni
przanoni at gmail.com
Mon Nov 4 17:08:19 CET 2013
2013/11/1 <ville.syrjala at linux.intel.com>:
> 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.
>
> v2: Use the named bits for VBT child device type
We go with this patch until they start creating analog eDP panels or
whatever else their creative minds come up with :)
Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
>
> 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_bios.h | 18 ++++++++++++++++++
> drivers/gpu/drm/i915/intel_dp.c | 3 ++-
> 2 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
> index f439c14..f580a2b 100644
> --- a/drivers/gpu/drm/i915/intel_bios.h
> +++ b/drivers/gpu/drm/i915/intel_bios.h
> @@ -654,6 +654,24 @@ int intel_parse_bios(struct drm_device *dev);
> #define DEVICE_TYPE_DIGITAL_OUTPUT (1 << 1)
> #define DEVICE_TYPE_ANALOG_OUTPUT (1 << 0)
>
> +/*
> + * Bits we care about when checking for DEVICE_TYPE_eDP
> + * Depending on the system, the other bits may or may not
> + * be set for eDP outputs.
> + */
> +#define DEVICE_TYPE_eDP_BITS \
> + (DEVICE_TYPE_INTERNAL_CONNECTOR | \
> + DEVICE_TYPE_NOT_HDMI_OUTPUT | \
> + DEVICE_TYPE_MIPI_OUTPUT | \
> + DEVICE_TYPE_COMPOSITE_OUTPUT | \
> + DEVICE_TYPE_DUAL_CHANNEL | \
> + DEVICE_TYPE_LVDS_SINGALING | \
> + DEVICE_TYPE_TMDS_DVI_SIGNALING | \
> + DEVICE_TYPE_VIDEO_SIGNALING | \
> + DEVICE_TYPE_DISPLAYPORT_OUTPUT | \
> + DEVICE_TYPE_DIGITAL_OUTPUT | \
> + DEVICE_TYPE_ANALOG_OUTPUT)
> +
> /* define the DVO port for HDMI output type */
> #define DVO_B 1
> #define DVO_C 2
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index f25a49e..ee3f573 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3284,7 +3284,8 @@ 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 & DEVICE_TYPE_eDP_BITS) ==
> + (DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS))
> return true;
> }
> return false;
> --
> 1.8.1.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Paulo Zanoni
More information about the Intel-gfx
mailing list