All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lyude <cpaul@redhat.com>
To: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: Fix enc_to_dig_port for MST encoders
Date: Thu, 04 Aug 2016 19:51:06 -0400	[thread overview]
Message-ID: <1470354666.4398.10.camel@redhat.com> (raw)
In-Reply-To: <1470188796-31850-4-git-send-email-dhinakaran.pandiyan@intel.com>

There was some discussion that happened on the original version of this
patch:

https://patchwork.kernel.org/patch/8960831/

The general consensus was while this fixed the issue, it probably isn't
the way we want to fix it. It would be a better idea just to have
enc_to_mst_primary() or something along those lines, or just use
enc_to_mst()->primary explicitly.

On Tue, 2016-08-02 at 18:46 -0700, Dhinakaran Pandiyan wrote:
> 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@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;
-- 
Cheers,
	Lyude
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-08-04 23:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03  1:46 Prep. for DP audio MST support Dhinakaran Pandiyan
2016-08-03  1:46 ` [PATCH 1/3] drm/i915: start adding dp mst audio Dhinakaran Pandiyan
2016-08-03  1:48   ` Yang, Libin
2016-08-04 23:42   ` Lyude
2016-08-05 17:10     ` Pandiyan, Dhinakaran
2016-08-03  1:46 ` [PATCH 2/3] drm/i915: Move audio_connector to intel_encoder Dhinakaran Pandiyan
2016-08-03  1:48   ` Yang, Libin
2016-08-04 23:43   ` Lyude
2016-08-03  1:46 ` [PATCH 3/3] drm/i915: Fix enc_to_dig_port for MST encoders Dhinakaran Pandiyan
2016-08-03  1:48   ` Yang, Libin
2016-08-04 23:51   ` Lyude [this message]
2016-08-05 17:48     ` Pandiyan, Dhinakaran
2016-08-03  1:47 ` Prep. for DP audio MST support Yang, Libin
2016-08-03  6:24 ` ✗ Ro.CI.BAT: failure for series starting with [1/3] drm/i915: start adding dp mst audio Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470354666.4398.10.camel@redhat.com \
    --to=cpaul@redhat.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.