Skip to content

Conversation

@stefan11111
Copy link
Contributor

This breaks on some nvidia cards.

Fixes: ed49ae8

This breaks on some nvidia cards.

Fixes: X11Libre@ed49ae8

Signed-off-by: stefan11111 <[email protected]>
@stefan11111
Copy link
Contributor Author

@notbabaisyou ping

@stefan11111
Copy link
Contributor Author

@metux @cepelinas9000 @notbabaisyou ping

@cepelinas9000
Copy link
Contributor

cepelinas9000 commented Dec 1, 2025

My knowledge is not deep in libdrm/drm, shouldn't we rebuild plane->crtc->encoder graph ?
As I understand, this problem manifest when plane has no configured crtc, but it allowed to use?

Or I totally wrong about this?

@stefan11111
Copy link
Contributor Author

stefan11111 commented Dec 1, 2025

My knowledge is not deep in libdrm/drm, shouldn't we rebuild plane->crtc->encoder graph ?

Not sure what you mean by this?

As I understand, this problem manifest when plane has no configured crtc, but it allowed to use?

Not necessarily, it may be that some of the primary planes have no configured crtc, while others have a crtc configured, but not the one we are on.

This code makes it so that we try to use a plane that is already on the current crtc, but if there is none, we use the first primary plane we find as a fallback.
This is so that we don't get a black screen in this sub-optimal case.

@stefan11111
Copy link
Contributor Author

Unrelated, but looking at this, doing drmSetClientCap(drmmode->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
in drmmode_crtc_create_planes also looks wrong. We should only do that once, in driver.c, not for every crtc.

@cepelinas9000
Copy link
Contributor

My knowledge is not deep in libdrm/drm, shouldn't we rebuild plane->crtc->encoder graph ?

Not sure what you mean by this?

I meant "...it may be that some of the primary planes have no configured crtc, ..."

On unrelated note, Looking at this I suspecting that we should start try to play with vkms (https://bootlin.com/pub/conferences/2025/elce/chauvet-vkms.pdf https://docs.kernel.org/gpu/vkms.html)

@stefan11111
Copy link
Contributor Author

stefan11111 commented Dec 2, 2025

My knowledge is not deep in libdrm/drm, shouldn't we rebuild plane->crtc->encoder graph ?

Not sure what you mean by this?

I meant "...it may be that some of the primary planes have no configured crtc, ..."

I got that, I'm not sure what you meant by 'rebuild plane->crtc->encoder graph'?

The code walks the planes returned by the kernel and, for primary planes, picks one we deem "best".
For this "best" plane, we parse it's IN_FORMATS and IN_FORMATS_ASYNC blobs, and then free what resources we allocated.

Now that I write this, I wonder how was I able to get a black screen on nvidia without this?
If we don't find a plane, we don't get any formats, which should mean 'driver chooses'.
@metux @notbabaisyou Any ideas?

On unrelated note, Looking at this I suspecting that we should start try to play with vkms (https://bootlin.com/pub/conferences/2025/elce/chauvet-vkms.pdf https://docs.kernel.org/gpu/vkms.html)

Some runtime CI would really be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants