All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Jani Nikula <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	linux-media@vger.kernel.org
Subject: Re: [RFC PATCH 6/7] drm: add support for DisplayPort CEC-Tunneling-over-AUX
Date: Fri, 26 May 2017 12:34:32 +0200	[thread overview]
Message-ID: <914a2100-800e-d2aa-7c28-3d53f50596d6@xs4all.nl> (raw)
In-Reply-To: <20170526071856.v6sj4yv2vj5x73aq@phenom.ffwll.local>

On 05/26/2017 09:18 AM, Daniel Vetter wrote:
> On Thu, May 25, 2017 at 05:06:25PM +0200, Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> This adds support for the DisplayPort CEC-Tunneling-over-AUX
>> feature that is part of the DisplayPort 1.3 standard.
>>
>> Unfortunately, not all DisplayPort/USB-C to HDMI adapters with a
>> chip that has this capability actually hook up the CEC pin, so
>> even though a CEC device is created, it may not actually work.
>>
>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>> ---
>>  drivers/gpu/drm/Kconfig      |   3 +
>>  drivers/gpu/drm/Makefile     |   1 +
>>  drivers/gpu/drm/drm_dp_cec.c | 196 +++++++++++++++++++++++++++++++++++++++++++
>>  include/drm/drm_dp_helper.h  |  24 ++++++
>>  4 files changed, 224 insertions(+)
>>  create mode 100644 drivers/gpu/drm/drm_dp_cec.c
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 78d7fc0ebb57..dd771ce8a3d0 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -120,6 +120,9 @@ config DRM_LOAD_EDID_FIRMWARE
>>  	  default case is N. Details and instructions how to build your own
>>  	  EDID data are given in Documentation/EDID/HOWTO.txt.
>>  
>> +config DRM_DP_CEC
>> +	bool
> 
> We generally don't bother with a Kconfig for every little bit in drm, not
> worth the trouble (yes I know there's some exceptions, but somehow they're
> all from soc people). Just smash this into the KMS_HELPER one and live is
> much easier for drivers. Also allows you to drop the dummy inline
> functions.

For all other CEC implementations I have placed it under a config option. The
reason is that 1) CEC is an optional feature of HDMI and you may not actually
want it, and 2) enabling CEC also pulls in the cec module.

I still think turning this into a drm config option makes sense. This would
replace the i915 config option I made in the next patch, i.e. this config option
is moved up one level.

Your choice, though.

> The other nitpick: Pls kernel-doc the functions exported to drivers, and
> then pull them into Documentation/gpu/drm-kms-helpers.rst, next to the
> existing DP helper section.

Will do.

BTW, do you know if it is possible to detect when a DP-to-HDMI adapter is
connected as I discussed in my cover letter? That's my main open question
for this patch series.

Regarding the other thing I discussed in the cover letter about detecting if
the CEC pin is really hooked up: I think I shouldn't try to be smart. Yes, I
can try to poll for a TV, but that doesn't really say anything about whether
CEC is working or not since the TV itself may not have enabled CEC (actually
quite common).

One alternative might be to poll and, if no TV is detected, call dev_info to
let the user know that either there is no CEC-enabled TV, or the CEC pin isn't
connected.

I'm not sure if that helps the user or not.

Regards,

	Hans

> 
> Thanks, Daniel

WARNING: multiple messages have this Message-ID (diff)
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Jani Nikula <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org
Subject: Re: [RFC PATCH 6/7] drm: add support for DisplayPort CEC-Tunneling-over-AUX
Date: Fri, 26 May 2017 12:34:32 +0200	[thread overview]
Message-ID: <914a2100-800e-d2aa-7c28-3d53f50596d6@xs4all.nl> (raw)
In-Reply-To: <20170526071856.v6sj4yv2vj5x73aq@phenom.ffwll.local>

On 05/26/2017 09:18 AM, Daniel Vetter wrote:
> On Thu, May 25, 2017 at 05:06:25PM +0200, Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> This adds support for the DisplayPort CEC-Tunneling-over-AUX
>> feature that is part of the DisplayPort 1.3 standard.
>>
>> Unfortunately, not all DisplayPort/USB-C to HDMI adapters with a
>> chip that has this capability actually hook up the CEC pin, so
>> even though a CEC device is created, it may not actually work.
>>
>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>> ---
>>  drivers/gpu/drm/Kconfig      |   3 +
>>  drivers/gpu/drm/Makefile     |   1 +
>>  drivers/gpu/drm/drm_dp_cec.c | 196 +++++++++++++++++++++++++++++++++++++++++++
>>  include/drm/drm_dp_helper.h  |  24 ++++++
>>  4 files changed, 224 insertions(+)
>>  create mode 100644 drivers/gpu/drm/drm_dp_cec.c
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 78d7fc0ebb57..dd771ce8a3d0 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -120,6 +120,9 @@ config DRM_LOAD_EDID_FIRMWARE
>>  	  default case is N. Details and instructions how to build your own
>>  	  EDID data are given in Documentation/EDID/HOWTO.txt.
>>  
>> +config DRM_DP_CEC
>> +	bool
> 
> We generally don't bother with a Kconfig for every little bit in drm, not
> worth the trouble (yes I know there's some exceptions, but somehow they're
> all from soc people). Just smash this into the KMS_HELPER one and live is
> much easier for drivers. Also allows you to drop the dummy inline
> functions.

For all other CEC implementations I have placed it under a config option. The
reason is that 1) CEC is an optional feature of HDMI and you may not actually
want it, and 2) enabling CEC also pulls in the cec module.

I still think turning this into a drm config option makes sense. This would
replace the i915 config option I made in the next patch, i.e. this config option
is moved up one level.

Your choice, though.

> The other nitpick: Pls kernel-doc the functions exported to drivers, and
> then pull them into Documentation/gpu/drm-kms-helpers.rst, next to the
> existing DP helper section.

Will do.

BTW, do you know if it is possible to detect when a DP-to-HDMI adapter is
connected as I discussed in my cover letter? That's my main open question
for this patch series.

Regarding the other thing I discussed in the cover letter about detecting if
the CEC pin is really hooked up: I think I shouldn't try to be smart. Yes, I
can try to poll for a TV, but that doesn't really say anything about whether
CEC is working or not since the TV itself may not have enabled CEC (actually
quite common).

One alternative might be to poll and, if no TV is detected, call dev_info to
let the user know that either there is no CEC-enabled TV, or the CEC pin isn't
connected.

I'm not sure if that helps the user or not.

Regards,

	Hans

> 
> Thanks, Daniel

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-05-26 10:34 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 15:06 [RFC PATCH 0/7] drm/i915: add support for DisplayPort CEC-Tunneling-over-AUX Hans Verkuil
2017-05-25 15:06 ` [RFC PATCH 1/7] cec: add CEC_CAP_NEEDS_HPD Hans Verkuil
2017-05-25 15:06 ` [RFC PATCH 2/7] cec-ioc-adap-g-caps.rst: document CEC_CAP_NEEDS_HPD Hans Verkuil
2017-05-25 15:06 ` [RFC PATCH 3/7] cec: add cec_s_phys_addr_from_edid helper function Hans Verkuil
2017-05-25 15:06 ` [RFC PATCH 4/7] cec: add cec_phys_addr_invalidate() " Hans Verkuil
2017-05-25 15:06 ` [RFC PATCH 5/7] drm/cec: Add CEC over Aux register definitions Hans Verkuil
2017-05-25 15:06   ` Hans Verkuil
2017-05-26  8:39   ` Jani Nikula
2017-05-26  8:39     ` Jani Nikula
2017-05-25 15:06 ` [RFC PATCH 6/7] drm: add support for DisplayPort CEC-Tunneling-over-AUX Hans Verkuil
2017-05-25 15:06   ` Hans Verkuil
2017-05-26  7:18   ` Daniel Vetter
2017-05-26  7:18     ` Daniel Vetter
2017-05-26 10:34     ` Hans Verkuil [this message]
2017-05-26 10:34       ` Hans Verkuil
2017-05-26 11:33       ` Daniel Vetter
2017-05-26 11:33         ` Daniel Vetter
2017-05-30 23:57     ` Clint Taylor
2017-05-31  6:40       ` Hans Verkuil
2017-05-25 15:06 ` [RFC PATCH 7/7] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Hans Verkuil
2017-05-25 15:06   ` Hans Verkuil
2017-05-26  7:15   ` Daniel Vetter
2017-05-26 10:20     ` Hans Verkuil
2017-05-26 10:20       ` Hans Verkuil
2017-05-29 19:00       ` Daniel Vetter
2017-05-30  7:02         ` Hans Verkuil
2017-05-30  7:02           ` Hans Verkuil
2017-05-30  7:11           ` Jani Nikula
2017-05-30 14:19             ` Clint Taylor
2017-05-30 16:49               ` Hans Verkuil
2017-05-30 16:54                 ` Hans Verkuil
2017-05-30 20:32                   ` Clint Taylor
2017-05-30 20:32                     ` Clint Taylor
2017-05-30 21:29                     ` Hans Verkuil
2017-05-30 23:25                       ` Clint Taylor
2017-05-30 23:25                         ` Clint Taylor
2017-05-31  6:37                         ` Hans Verkuil
2017-05-30 20:31                 ` Clint Taylor
2017-05-30 20:31                   ` Clint Taylor
2017-05-26 10:13   ` Jani Nikula
2017-05-26 10:13     ` Jani Nikula
2017-05-26 10:13     ` Hans Verkuil
2017-05-26 10:13       ` Hans Verkuil
2017-05-25 15:30 ` [RFC PATCH 0/7] drm/i915: add support for DisplayPort CEC-Tunneling-over-AUX Mike Lothian
2017-05-25 15:56   ` Hans Verkuil
2017-05-25 15:34 ` ✓ Fi.CI.BAT: success for " 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=914a2100-800e-d2aa-7c28-3d53f50596d6@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hans.verkuil@cisco.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --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 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.