DisplayPort: Under The Hood

Last time, we looked at all the things that make DisplayPort unique for its users. What about the things that make it unique for hackers? Let’s get into all the ways that DisplayPort can serve you on your modern tech wrangling adventures.

You Are Watching The AUX Channel

With DisplayPort, the I2C bus we’ve always seen come bundled with VGA, DVI and HDMI, is no more – it’s been replaced by the AUX bus. AUX is a 1 MHz bidirectional diffpair – just a bit too complex for a cheap logic analyzer, though, possibly, something you could wrangle with the RP2040’s PIOs. Hacking thoughts aside, it’s a transparent replacement for I2C, so that software doesn’t have to be rewritten – for instance, it usually does I2C device passthrough over AUX, so that EDID data can still be stored in a separate EEPROM chip on the monitor or eDP LCD panel.

AUX isn’t just a differential bus, it’s more pseudodifferential, like USB2 – for instance, AUX_P and AUX_N are used separately, with a combination of 1 MΩ and 100 kΩ pullups and pulldowns signaling different states of the physical connection – for instance, a pullup on AUX+ and a pulldown on AUX- means that an external device has been connected. If you’d like to learn which combination of resistors means what, you can find in the DisplayPort specification, which isn’t distributed openly but isn’t hard to come by, either.

Also, DisplayPort link training happens over AUX, and in order to facilitate that, a piece of DisplayPort controller’s external memory is usually exposed over the AUX channel, through a mechanism that’s called DPCD. If you dig a bit, using “DPCD” as the keyword, you can easily reach into the lower-level details of your DisplayPort connection. Some of the DPCD memory map is static, and some parts are FIFOs you can funnel data into, or out of. You can find a wide variety of documents online which describe the DPCD structure – for now, here’s a piece of Bash that works on Linux graphics drivers for AMD and Intel, and will show you you the first 16 bytes of DPCD:

# sudo dd if=/dev/drm_dp_aux0 bs=1 skip=256 count=16 |xxd
00000000: 0084 0000 0000 0000 0108 0000 0000 0000 ................

In particular, the 4th nibble (digit) here describes the amount of lanes for the DisplayPort link established – as you can see, my laptop uses a four-lane link. Also, the /dev/drm_dp_aux0 path might need to be adjusted for your device. In case you ever want to debug your DP link, having direct access to the DPCD memory space like this might help you quite a bit! For now, let’s move onto other practical aspects.

Got eDP, Now What?

What if you have an eDP display handy and you’d like to reuse it in a project? First, you’ll want to know the pinout. For laptop displays, the eDP panel pinouts are reasonably standardized – there are three pinouts, one of them 30-pin 2-lane, one 40-pin 2-lane with extra USB and I2C pins for wiring up a touchscreen, and one 40-pin connector with 4 lanes and no touchscreen support; you can see more details on these pinouts here. Other pinouts exist, but they’re rare – my friend has so far found one display within a Wacom tablet, which uses the 30-pin pinout but flips the pins, so that pin 1 is mapped to pin 30 of the connector and so on; this has, sadly, resulted in magic smoke. That said, this is rare, and a quick board trace observation or even a multimeter check will spare you such trouble if you’re unsure. Also, the panel datasheet will answer all of your questions, if not all.

If your pinout is the 30-pin one, you’re in luck – there’s a wide variety of driver boards with same hardware and panel-tailored firmware; there are also generic boards that tend to work well with 1920 x 1080 panels, the most popular resolution for laptop screens within the past five years. It does seem like those boards might make certain kinds of shortcuts when it comes to DisplayPort link management, however – whether they assume link training parameters of the panel they’re programmed for, or perhaps it’s the pixel format, but my experience has shown – if you can grab a board that’s labelled to be programmed for your specific panel, consider doing just that; otherwise, it might not start, or, you might get visual interfaces or weird flickering. On the other hand, as I’ve been getting into laptop display reuse, I’ve found a few boards where the DP panel resolution can be set with jumpers, and those have proven themselves to be more than universal enough, so if you can grab one alongside your pre-programmed board order, you might be rewarded with greater compatibility than you’d expect for any further eDP tinkering adventures of yours.

When it comes to tablet eDP displays, it’s way less standardized, but you can absolutely get by with the panel’s datasheets or even schematics. Sometimes, there’s even ready-to-go DisplayPort breakouts for a certain kind of display, but it’s rare, and you might want to bodge your own. Of course, bodging a 2.7 Gbps link with jumper wires isn’t as viable, this is not PCIe, which is to say, you’re getting into the territory of drawing your own DisplayPort-carrying PCB. Let’s equip you accordingly.

Taming The Diffpairs

Of course, like any self-respecting high-bandwidth interface of modern day, DisplayPort uses differential pairs. Now, this wouldn’t be the first interface that we need to draw controlled impedance pairs for – you can revisit the PCIe diffpair routing article for the basics. There are differences between PCIe and DisplayPort routing, of course – for a start, DisplayPort needs 100 ohm impedance, as opposed to PCIe’s 85 ohms; not much of a problem and the pairs parameters won’t even be all that different. However, there are also further restrictions – as a result of those, DisplayPort no longer has the “wet string” factor.

Remember how I mentioned that, for PCIe, you don’t need to bring all the pairs to the same length. Well, that’s the problem now, you do have bring all the differential pairs to the same length for DisplayPort, in addition to the intra-pair skew compensation that you still have to do. In KiCad, the tool for that is mapped to the key 8, and it lets you lengthen individual pairs by adding wiggles, of the kind that you most likely have already seen on PCBs out there.

Now, according to the specification, the between-pair difference can be from 5 cm to 1 cm total, depending on the DisplayPort link speed. You might think that you have some leeway here, but it’s better if you limit your differences into the 1 mm –  2 mm millimeter range – some of your leeway might be already “spent” by your GPU, your cabling, or your monitor, in short, whatever parts of the DP link that you don’t control.

In addition to the inter-pair length matching, DisplayPort link training isn’t as accommodating. You can no longer flip pairs whenever you need to do that to make your routing prettier, as much as that might be tempting – the DisplayPort link do not treat that with kindness. On the bright side, this more or less marks the end of what you need to know to route the main link differential pairs.

This is enough for you to dive into the DisplayPort pool – but first, let me let you in on one last thing you should know. You’ve learned about the main link pairs, you’ve learned about the AUX bus – I’d like to bring the HPD signal to your attention. Despite the existence of the AUX bus, HPD is a required signal for a DisplayPort link, since, in a way, AUX is just like USB 2.0 – a display (device, sink) can’t speak until it’s spoken to; HPD is its way of bringing attention to itself, avoiding polling that USB has to use. It’s also a signal used for display hotplug, apparently, necessarily complementary to the method used on the AUX pairs to detect when a display has been connected. In short, make sure you don’t omit HPD.

DisplayPort Conquered, Altmode Is Next

Today, hopefully, I’ve provided enough information for you to be comfortable handling a DisplayPort link, whenever you might decide to take upon such a responsibility! We would be remiss to not talk about the DisplayPort altmode in more depth – the intersection of two widely adopted modern-day technologies, DisplayPort and USB-C. Next time, we’ll see towards making you comfortable handling that, too, with the amount of depth that I hope you will appreciate. Until then – here’s to making you more comfortable in modern-day display technology fields!

14 thoughts on “DisplayPort: Under The Hood

  1. I still fail to see how it’s any better than analog RGBA signal being sent over coax. If some foreign civilisation ever records our RF emissions they’ll see a jumbled mess. Analog signal can be understood and recovered by pretty much anyone, human or otherwise.

    1. “If some foreign civilisation ever records our RF emissions…” “over coax”

      Then it’s time to fire all the CATV techs.
      That’s a lot of leakage!

      “I still fail to see how it’s any better ”

      Well, with your foreign civilisation[sic] comment I guess you actually mean broadcast, OTA signals. Not wha tthis article was about. In that case the answer is bandwidth. We can do a LOT more in the same bandwidth with digital than with analog. The population is going up. And even as we have more individuals using bandwidth the expectation each individual has of their technology is also going up. Physics however is not changing so available bandwidth stays the same. Using it more efficiently is the only answer we have.

      OTOH, if you are talking about signals running over cables, which this article was about. Well.. they look a lot better digital. Especially as we cram so many more pixels into a display. At some point analog would just fall apart.

      1. “Physics however is not changing so available bandwidth stays the same. Using it more efficiently is the only answer we have.”

        Lol! As if dirty digital signals solve this issue! They’re harmonic generators! They pollute the whole spectrum! 😂

    2. I also think we should drive those analog RGBA signals with tubes. Should civilization collapse, we should be able to make replacement parts with a soldering iron, salvaged aluminum foil, a pedal-driven vacuum pump, some sand, and a glass-working furnace.

      1. “I also think we should drive those analog RGBA signals with tubes.”

        That works, a CRT TV or CRT VGA monitor technically has three tubes, each one for R/G/B.
        Back in the 60s and before, there were tube amps inside the TV or video monitor.
        If SCART had existed 20 years earlier, it would have been using using tubes, still.

        “pedal-driven vacuum pump”

        Actually, a water-driven pump might actually work. It can be attached to the water tap and creates a vacuum.

        “Should civilization collapse, we should be able to make replacement parts with a soldering iron, salvaged aluminum foil, a pedal-driven vacuum pump, some sand, and a glass-working furnace.”

        Yup. And the best thing is: Through natural selection, all those C/C++ and *nix freaks will be gone first, with the assembly and BASIC programmers still being able to improvise. A win-win situation?

    3. Aliens would have a hard time figuring out DRM (such as HDCP) that keeps digital signal from being shared or recorded. With analog signal, anyone can read and find out Earth is not going to be a fun tourist spot to stop at.

    4. If the video is generated from a digital system and sent to a digital panel, what’s the sense in degrading it via D/A, coax and connector losses, and A/D at the other end? Why waste a bunch of transmission time sending blanking for an analog display to retrace? Error correction, data compression, multiple data streams, encryption? Cost of shielded twisted pair vs. coax? There are lots of reasons. Last I checked aliens receiving our video didn’t hold much sway in the market.

      1. The number of early consumer LCDs in the ’00s with only VGA connectors annoyed me endlessly. “Hey, let’s take a brand new awesome monitor technology and hamstring one huge advantage – a sharp picture – by requiring D/A then A/D conversion!” I totally get adding them (at the time) for compatibility reasons, but the VGA-only panels baffle me.

        I still get an eye twitch when I see someone using a modern PC with a VGA cable to a modern display simply because it’s the one that came in the box. Samsung displays in the 2010s were terrible for this.

    5. I know where you’re coming from, believe me. I feel it too. I cringe a little every time I use a 5 Gb/s interface (USB) to talk to a 9600 baud acoustic current profiler. :-) What I worry about is the long-term sustainability of some of these “new” protocols.

      Example: I have a Dell 3007WFP thirty inch LCD that requires dual-link DVI input. So far I have had no success finding a type-C-connector -to- dual-link DVI adapter. Vendors claim their adapter is dual-link, but what they mean is it supports single-width digital and analog in the same cable. So I now have a very nice monitor that can only be driven at 800×600 from a new MacBook Pro (work machine, I didn’t buy it). If anyone positively knows of an adapter that works, please let me know! :-) (I can still drive the 30″ LCD from an *old* desktop running VNC, but the heat and the noise are irritating)

      With that said (grin), the story on VGA that was given to me was that analog signaling was too sensitive to cheap cables at 1600×1200 (I could tell that myself) and was too expensive at 1920x1080p30. The problems were both tolerance stack-up not leaving a lot of wiggle room and the need for what was at the time (2010-ish?) going to be a slightly “fast” and hence more expensive A/D converter in the displays. I remember it described as a market “where pennies matter”. Higher slew rates were also requiring more power in the amplifiers driving the cable from the graphics card. I can see that being a factor for laptops.

  2. DP Alt Mode article will be fun! HPD signal translates into a MSI via USB PD Structured VDM and re-constructed as the DP-specified HPD/Interrupt signal by respective USB PD controller on the DP Source’s end of the link.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.