-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
context_drm_egl: allow autoprobe selection #9033
Conversation
This was explictly coded to avoid the autoprobe way back when in 2015[1] with no real explanation. In theory, there shouldn't be any issues allowing this. If a user runs mpv in tty, this is probably what they actually want in most cases. Perhaps something strange happens on nvidia, but it should just fail anyway during the autoprobe. [1]: mpv-player@f757163
@Dudemanguy #2459 |
Thanks, I didn't realize that had a PR.
I guess the crux is whether or not this still true. At least, I've never had any problems. |
I'm comfortable allowing autoprobe. I've never seen conflicts with running X servers when testing drm_egl before. |
I think there are some (maybe rare these days) configurations where trying to do these DRM things will rip your X server to shreds. There are still some potential issues around VT switching though, and just other general roughness of this output that speaks against enabling it by default, and having it be a conscious choice by an experienced user who knows what they are getting into. Speaking of the VT switching issues. Since a few kernels back drmSetMaster/drmDropMaster work w/o root privileges. We should probably make a PR to start using these to make VT switching less likely of blowing your X11 server/wayland server up (in my experience even with this, sometimes things go south though!) |
Technically speaking, The other option would have been to add an autoprobe check to |
Yeah. You can argue I should have disabled autoprobe but you don't even try using mpv on a try unless you want to get one of these backends working. The sharp edges don't come in to play unless you're looking for them. |
Btw there's a multitude of bugs that got fixed in the area - there's the laundry-list and some details behind each one
As the comment says, the functions may fail, but not calling them in the first place is just bonkers. Note that with linux v5.10 and later aka this kernel commit the root requirement was reworked and mpv should just work. Please re-enable the drmSet/DropMaster calls, or I'll try to get to it tomorrow. Disclaimer: I've wrote the kernel patches, plus some of the mesa ones. I don't recall all the required mesa patches, hence no links. |
I remember having issues with drmSet/DropMaster. They required root privileges, and no one on the Internet could explain why, which is why we didn't enable them. Apparently that is no longer the case so maybe whatever the original issue was will resolve automatically.
I disagree. I remember calling these functions crashing my running X server on VT2 without any warning. Now that is bonkers. In general this stuff was severely underdocumented back in the day, and our main source of knowledge was a project called kms cube. |
I've been meaning to get to the VT side of things, but I'm no longer very active in this project. Patches welcome! If drmSetMaster fails VT switching should be altogether disabled, methinks. What about the (admittedly somewhat odd) case when someone is using X11 or say weston with the fbdev backend, despite being on modesetting supported HW, running mpv will steal the screen from fbdev, when I as a user would probably expect vo_x11 or vo_wayland to be autodetected. There's also the danger of losing control over mpv if the user unfocuses the controlling terminal (with the DRM backend mpv just uses the controlling terminal for input, because it's simple and requires no extra code for input handling... although implementing proper input handling might be a project for the future if someone is interested enough in it) @rr- |
The commit linked explains why the ioctls require root access. Although the mpv team is always welcome to reached out and ask - DRM folks don't bite. |
Sometimes I use drm and I got annoyed by having to type --gpu-context=drm. The drm context has been explicitly coded to disallow the autoprobe almost its entire existence (since: f757163). @rr-: do you remember what the reason for that commit was?