[Intel-gfx] [PATCH 3/3] drm/i915: Fix enc_to_dig_port for MST encoders
Yang, Libin
libin.yang at intel.com
Wed Aug 3 01:48:40 UTC 2016
Add Takashi
Regards,
Libin
> -----Original Message-----
> From: Pandiyan, Dhinakaran
> Sent: Wednesday, August 3, 2016 9:47 AM
> To: intel-gfx at lists.freedesktop.org
> Cc: cpaul at redhat.com; ville.syrjala at linux.intel.com; Yang, Libin
> <libin.yang at intel.com>; Pandiyan, Dhinakaran
> <dhinakaran.pandiyan at intel.com>
> Subject: [PATCH 3/3] drm/i915: Fix enc_to_dig_port for MST encoders
>
> When a MST encoder is passed to enc_to_dig_port(), the container_of() macro
> does not return the digital port. Handle this by returning the member
> "primary" in "struct intel_dp_mst_encoder"
>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> ---
> drivers/gpu/drm/i915/intel_drv.h | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h
> b/drivers/gpu/drm/i915/intel_drv.h
> index 45020d2..66af444 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1023,18 +1023,22 @@ intel_attached_encoder(struct drm_connector
> *connector)
> return to_intel_connector(connector)->encoder;
> }
>
> -static inline struct intel_digital_port * -enc_to_dig_port(struct drm_encoder
> *encoder) -{
> - return container_of(encoder, struct intel_digital_port, base.base);
> -}
> -
> static inline struct intel_dp_mst_encoder * enc_to_mst(struct drm_encoder
> *encoder) {
> return container_of(encoder, struct intel_dp_mst_encoder,
> base.base); }
>
> +static inline struct intel_digital_port * enc_to_dig_port(struct
> +drm_encoder *encoder) {
> + if (encoder->encoder_type == DRM_MODE_ENCODER_DPMST)
> + return enc_to_mst(encoder)->primary;
> + else
> + return container_of(encoder, struct intel_digital_port,
> + base.base);
> +}
> +
> static inline struct intel_dp *enc_to_intel_dp(struct drm_encoder *encoder) {
> return &enc_to_dig_port(encoder)->dp;
> --
> 2.5.0
More information about the Intel-gfx
mailing list