linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carlos Santa <carlos.santa@intel.com>
To: Hans Verkuil <hverkuil@xs4all.nl>, linux-media@vger.kernel.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 3/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support
Date: Wed, 09 Aug 2017 17:39:22 -0700	[thread overview]
Message-ID: <1502325562.76063.10.camel@intel.com> (raw)
In-Reply-To: <20170711133011.41139-4-hverkuil@xs4all.nl>

On Tue, 2017-07-11 at 15:30 +0200, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Implement support for this DisplayPort feature.
> 
> The cec device is created whenever it detects an adapter that
> has this feature. It is only removed when a new adapter is connected
> that does not support this. If a new adapter is connected that has
> different properties than the previous one, then the old cec device
> is
> unregistered and a new one is registered to replace the old one.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---

This was tested internally using the EE-PW700 adapter (DisplayPort/USB-
C to HDMI) from Samsung on a Skylake platform.

Several commands were tested including: 

# cec-ctl --playback

# turns the TV off
# cec-ctl -t=0 --standby

# turns the TV on
# cec-ctl -t=0 --image-view-on

The cec-compliance binary was also run and it reported no failures.

Tested-by: Carlos Santa <carlos.santa@intel.com>

>  drivers/gpu/drm/i915/intel_dp.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index 64fa774c855b..fdb853d2c458 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -32,6 +32,7 @@
>  #include <linux/notifier.h>
>  #include <linux/reboot.h>
>  #include <asm/byteorder.h>
> +#include <media/cec.h>
>  #include <drm/drmP.h>
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_crtc.h>
> @@ -1449,6 +1450,7 @@ static void intel_aux_reg_init(struct intel_dp
> *intel_dp)
>  static void
>  intel_dp_aux_fini(struct intel_dp *intel_dp)
>  {
> +	cec_unregister_adapter(intel_dp->aux.cec_adap);
>  	kfree(intel_dp->aux.name);
>  }
>  
> @@ -4587,6 +4589,7 @@ intel_dp_set_edid(struct intel_dp *intel_dp)
>  	intel_connector->detect_edid = edid;
>  
>  	intel_dp->has_audio = drm_detect_monitor_audio(edid);
> +	cec_s_phys_addr_from_edid(intel_dp->aux.cec_adap, edid);
>  }
>  
>  static void
> @@ -4596,6 +4599,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
>  
>  	kfree(intel_connector->detect_edid);
>  	intel_connector->detect_edid = NULL;
> +	cec_phys_addr_invalidate(intel_dp->aux.cec_adap);
>  
>  	intel_dp->has_audio = false;
>  }
> @@ -4616,13 +4620,17 @@ intel_dp_long_pulse(struct intel_connector
> *intel_connector)
>  	intel_display_power_get(to_i915(dev), intel_dp-
> >aux_power_domain);
>  
>  	/* Can't disconnect eDP, but you can close the lid... */
> -	if (is_edp(intel_dp))
> +	if (is_edp(intel_dp)) {
>  		status = edp_detect(intel_dp);
> -	else if (intel_digital_port_connected(to_i915(dev),
> -					      dp_to_dig_port(intel_d
> p)))
> +	} else if (intel_digital_port_connected(to_i915(dev),
> +						dp_to_dig_port(intel
> _dp))) {
>  		status = intel_dp_detect_dpcd(intel_dp);
> -	else
> +		if (status == connector_status_connected)
> +			drm_dp_cec_configure_adapter(&intel_dp->aux,
> +				     intel_dp->aux.name, dev->dev);
> +	} else {
>  		status = connector_status_disconnected;
> +	}
>  
>  	if (status == connector_status_disconnected) {
>  		memset(&intel_dp->compliance, 0, sizeof(intel_dp-
> >compliance));
> @@ -5011,6 +5019,8 @@ intel_dp_hpd_pulse(struct intel_digital_port
> *intel_dig_port, bool long_hpd)
>  
>  	intel_display_power_get(dev_priv, intel_dp-
> >aux_power_domain);
>  
> +	drm_dp_cec_irq(&intel_dp->aux);
> +
>  	if (intel_dp->is_mst) {
>  		if (intel_dp_check_mst_status(intel_dp) == -EINVAL)
> {
>  			/*

  parent reply	other threads:[~2017-08-10  0:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 13:30 [PATCH 0/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Hans Verkuil
2017-07-11 13:30 ` [PATCH 1/3] drm: add support for DisplayPort CEC-Tunneling-over-AUX Hans Verkuil
2017-08-10  0:34   ` Carlos Santa
2017-08-10 19:19   ` Sean Paul
2017-07-11 13:30 ` [PATCH 2/3] drm-kms-helpers.rst: document the DP CEC helpers Hans Verkuil
2017-07-11 13:30 ` [PATCH 3/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Hans Verkuil
2017-07-12 20:07   ` [PATCH for 4.13] cec: cec_transmit_attempt_done: ignore CEC_TX_STATUS_MAX_RETRIES Hans Verkuil
2017-08-10  0:39   ` Carlos Santa [this message]
2017-08-09 10:01 ` [PATCH 0/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Hans Verkuil

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=1502325562.76063.10.camel@intel.com \
    --to=carlos.santa@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).