<div dir="ltr">Hi<div><br></div><div>Sorry if this is off topic, I've got a Skylake Dell laptop with a USB-C connector and no displayport </div><div><br></div><div>Which USB-C -> HDMI-2.0 connector do you recommend for stuff just working based on your testing?</div><div><br></div><div>I've been putting off buying one until I knew 4K@60Hz would work, CEC would be nice to have too</div><div><br></div><div>Thanks</div><div><br></div><div>Mike</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 25 May 2017 at 16:06 Hans Verkuil <<a href="mailto:hverkuil@xs4all.nl">hverkuil@xs4all.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Hans Verkuil <<a href="mailto:hans.verkuil@cisco.com" target="_blank">hans.verkuil@cisco.com</a>><br>
<br>
This patch series adds support for the DisplayPort CEC-Tunneling-over-AUX<br>
protocol.<br>
<br>
This patch series is based on v4.12-rc2.<br>
<br>
The first four patches add support for a new CEC capability which is<br>
needed for these devices and for two helper functions.<br>
<br>
Then the DP CEC registers are added using Clint's patch.<br>
<br>
The core CEC tunneling support is added to drm_dp_cec.c.<br>
<br>
And finally this is hooked up in the i915 driver.<br>
<br>
Ideally the cec driver is created and destroyed whenever the DP-to-HDMI<br>
adapter is connected/disconnected, but I have not been a able to find<br>
a way to distinguish between connecting/disconnecting the HDMI cable<br>
and connecting/disconnecting the actual DP-to-HDMI adapter.<br>
<br>
My current approach is to check the CEC tunneling support whenever a new<br>
display is connected:<br>
<br>
- if CEC tunneling is supported, but no CEC adapter exists, then create one.<br>
- if CEC tunneling is not supported, then unregister the CEC adapter if one<br>
was created earlier.<br>
- if CEC tunneling is supported and the capabilities are identical to the<br>
existing CEC adapter, then leave it be.<br>
- if CEC tunneling is supported and the capabilities are different to the<br>
existing CEC adapter, then unregister that CEC adapter and register a<br>
new one.<br>
<br>
This works well, but it would be much nicer if I would just know when the<br>
DP adapter is disconnected as opposed to when the HDMI cable is disconnected<br>
from the adapter. Suggestions are welcome.<br>
<br>
The other remaining problem is that there are DP/USB-C to HDMI adapters that<br>
support CEC tunneling in the chipset, but where the CEC pin is simply never<br>
hooked up. From the point of view of the driver CEC is supported, but you'll<br>
never see any other devices.<br>
<br>
I am considering sending a CEC POLL message to logical address 0 (the TV)<br>
to detect if the CEC pin is connected, but this is not 100% guaranteed to<br>
work. This can be put under a kernel config option, though.<br>
<br>
I think I need to do something for this since of the 5 USB-C to HDMI<br>
adapters I've tested that set the CEC tunneling capability, only 2 have<br>
the CEC pin hooked up. So this seems to be quite common.<br>
<br>
I have tested this with my Intel NUC7i5BNK and with the two working<br>
USB-C to HDMI adapters that I have found:<br>
<br>
a Samsung EE-PW700 adapter and a Kramer ADC-U31C/HF adapter (I think that's<br>
the model, I need to confirm this).<br>
<br>
As usual the specifications of these adapters never, ever tell you whether<br>
this is supported or not :-( It's trial and error to find one that works. In<br>
fact, of the 10 USB-C to HDMI adapters I tested 5 didn't support CEC tunneling<br>
at all, and of the remaining 5 only two had the CEC pin hooked up and so<br>
actually worked.<br>
<br>
BTW, all adapters that supported CEC tunneling used the Parade PS176 chip.<br>
<br>
Output of cec-ctl -S (discovers the CEC topology):<br>
<br>
$ cec-ctl -S<br>
Driver Info:<br>
Driver Name : i915<br>
Adapter Name : DPDDC-C<br>
Capabilities : 0x0000007e<br>
Logical Addresses<br>
Transmit<br>
Passthrough<br>
Remote Control Support<br>
Monitor All<br>
Driver version : 4.12.0<br>
Available Logical Addresses: 4<br>
Physical Address : 3.0.0.0<br>
Logical Address Mask : 0x0010<br>
CEC Version : 2.0<br>
Vendor ID : 0x000c03 (HDMI)<br>
OSD Name : 'Playback'<br>
Logical Addresses : 1 (Allow RC Passthrough)<br>
<br>
Logical Address : 4 (Playback Device 1)<br>
Primary Device Type : Playback<br>
Logical Address Type : Playback<br>
All Device Types : Playback<br>
RC TV Profile : None<br>
Device Features :<br>
None<br>
<br>
System Information for device 0 (TV) from device 4 (Playback Device 1):<br>
CEC Version : 1.4<br>
Physical Address : 0.0.0.0<br>
Primary Device Type : TV<br>
Vendor ID : 0x0000f0 (Samsung)<br>
OSD Name : TV<br>
Menu Language : eng<br>
Power Status : On<br>
<br>
Topology:<br>
<br>
<a href="http://0.0.0.0" rel="noreferrer" target="_blank">0.0.0.0</a>: TV<br>
<a href="http://3.0.0.0" rel="noreferrer" target="_blank">3.0.0.0</a>: Playback Device 1<br>
<br>
Regards,<br>
<br>
Hans<br>
<br>
Clint Taylor (1):<br>
drm/cec: Add CEC over Aux register definitions<br>
<br>
Hans Verkuil (6):<br>
cec: add CEC_CAP_NEEDS_HPD<br>
cec-ioc-adap-g-caps.rst: document CEC_CAP_NEEDS_HPD<br>
cec: add cec_s_phys_addr_from_edid helper function<br>
cec: add cec_phys_addr_invalidate() helper function<br>
drm: add support for DisplayPort CEC-Tunneling-over-AUX<br>
drm/i915: add DisplayPort CEC-Tunneling-over-AUX support<br>
<br>
.../media/uapi/cec/cec-ioc-adap-g-caps.rst | 8 +<br>
drivers/gpu/drm/Kconfig | 3 +<br>
drivers/gpu/drm/Makefile | 1 +<br>
drivers/gpu/drm/drm_dp_cec.c | 196 +++++++++++++++++++++<br>
drivers/gpu/drm/i915/Kconfig | 11 ++<br>
drivers/gpu/drm/i915/intel_dp.c | 46 ++++-<br>
drivers/media/cec/cec-adap.c | 34 +++-<br>
drivers/media/cec/cec-api.c | 5 +-<br>
drivers/media/cec/cec-core.c | 1 +<br>
include/drm/drm_dp_helper.h | 83 +++++++++<br>
include/media/cec.h | 15 ++<br>
include/uapi/linux/cec.h | 2 +<br>
12 files changed, 394 insertions(+), 11 deletions(-)<br>
create mode 100644 drivers/gpu/drm/drm_dp_cec.c<br>
<br>
--<br>
2.11.0<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</blockquote></div>