drm: expose the connector TILE property#2034
Conversation
The first generation of 5K monitors (LG UltraFine 5K, Dell UP2715K, mid-2010s) couldn't fit 5120x2880@60 down a single DP 1.2 cable and instead carry the image as two streams, one per tile half. Each half presents as its own DRM connector, with a DisplayID Tile Topology block in its EDID describing where it sits in the monitor. The kernel parses that block and exposes the result as the `TILE` immutable blob, formatted as eight ':'-delimited decimals: group_id:flags:num_h_tiles:num_v_tiles:loc_h:loc_v:tile_w:tile_h. Newer 5K panels carry the image on a single cable using DSC over DP 1.4, or uncompressed over DP 2.1 UHBR. `DrmDevice::tile_info()` reads the blob, parses it into a new `backend::drm::TileInfo` struct, and returns `None` for connectors without one. Compositors can use the shared `group_id` to identify connectors that belong to the same physical monitor. The kernel's `flags` field is parsed and discarded. It isn't documented and Mutter ignores it. AI-generated: This code was co-authored with Claude (Anthropic).
|
Hmm. Exposing the TILE property is definitely not wrong, as we need this information to correctly handle this case. I just wonder if a pure drm-helper in smithay is the right approach or whether we could provide more abstractions for this in smithay and if we perhaps even should.
Either way thanks for working on this. We might just need a little more design work first. Luckily the code you wrote so far for smithay at least is very universally applicable and just needs to be moved around at worst. |
|
@Drakulix thanks!
Yeah, so to make this work on my monitor, I currently have a hack in cosmic-comp. The halves are rendered side-by-side, but if I change the COSMIC "Orientation" setting, it goes completely screwy. This is because my hack translates the 5120x2880 by subtraction for the right hand half. In a 90-degree orientation the halves are above each other, so it's not X that needs shifting.
That's correct. In discussion with Claude the recommendation is a "subsurface" abstraction in smithay, but I was a bit weary to suggest big API changes in my first ever interaction with your project.
Yeah, I wouldn't know. This is my only 5K monitor :)
Sounds like that is the direction and the Bigger Picture (lol).
On some level, I sorted my own problem locally, but I'm also happy to spend effort making this work for others. I'm happy to take your lead on what direction to take. |
Glad to hear that, because frankly a half-AI-coded personal workaround, isn't really suitable for long-term maintenance and thus inclusion in either project. So the path forward I am seeing here (as you already figured out) would be to support multiple DrmSurfaces in the DrmCompositor. Probably as a new constructor, something like (I don't want to introduce "sub"-surfaces to the This means we also need the following changes to the
Does this make some sense? |
Makes perfect sense! Thank you so much for taking the time to point me in the good direction. I'll take a stab at this tomorrow (Saturday). I'll leave this PR as is, we will see if we close it out or not – I guess I'm not clear on whether Again, thanks! |
|
Just a quick note that I have it working locally now, but since I relied on AI, I need to review commit-by-commit closely before I open any PR. If anyone is interested what's going on, here are my WIP branches. |
|
First of thanks for working on this! Before digging deeper I want make sure I understand some of the design decisions correctly. One thing we should be really careful of is that testing will carry out the same as we do for the commit/pageflip. |
Thanks for taking a look!
I kept it on top of I don't know if there is a use case here, but I imagined it would be possible to use the tiled output with several normal screens on the same card too.
You're right. I'll make a new test using the same DrmAtomicCommit builder so it spans all tiles, rather than make |
Disclosure: I have done this PR using Claude Code. Whilst I am well versed in Rust (I wrote ureq among other), I know very little about the graphics stack in Linux. I had Claude teach me what I need to know to fix my problem.
I use a LG UltraFine 5K that is about 8 years old and uses tiled DP 1.2 to render 5K. I just now installed PopOS/COSMIC and it doesn't drive my monitor correctly. The monitor is Thunderbolt only, and connected to a Maple Ridge PCIe card that in turn takes two DP cables from my NVIDIA card. I believe the problem is described here (pop-os/cosmic-comp#2295)
The monitor presents itself as two DP streams with two EDID. In the EDID there is a TILE property, which is available in drm, but currently not possible to read from Smithay.
This TILE property contains the necessary info to understand that it's a tiled situation and the DP streams should be rendered to as if two halves of the same screen.
The PR adds
backend::drm::TileInfoandDrmDevice::tile_info(), along with the ASCII-blob parser for the kernel format. It is what is needed from Smithay.I got the full thing working in cosmic-comp locally.
group_id, positions(0,0)and(1,0)in a 2x1 grid, tile size 2560x2880.