-
Notifications
You must be signed in to change notification settings - Fork 3.2k
vo_drm: add KMS/DRM renderer support #1811
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
Conversation
For now, it displays noise. Obviously this is just a placeholder for real draw functions.
With this implementation I experienced all sorts of problems, such as lags and tearing. But it's a good starting point for future improvements.
Rather than assuming the first connector to be the one that's currently connected, we iterate and choose first connector that is truly available.
|
What I have tested:
What I haven't tested:
|
video/out/vo_drm.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe talloc_ptrtype(vo->priv, dev)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, for defensive programming, talloc_zero(vo->priv, struct modeset_dev) would be better.
|
Looks pretty good. I made some comments about mostly minor issues. I don't know the DRM API, so I can't say anything about that part. |
|
Thanks. I'll fix all of these tomorrow. |
video/out/vo_drm.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, you can just write struct drm_mode_create_dumb creq = {0};.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: or actually struct drm_mode_create_dumb creq = { .width = buf->width, ....
|
I added some more comments. There are just some minor things, and I'd say it's ready for merge. The OSD redrawing thing is possibly a bit more complicated, but optional. |
|
@wm4 I'll fix these ASAP I get home. |
|
I gave this a test. The image appeared, but in the next moment the monitor turned itself off. Switching to a different VT and back, the monitor was on again, showing a segmentation fault. Then I figured, I used a 16/9 video, let's try a 4/3 one. This time it worked great. I have a 16/10 monitor. So there's an issue when the video has a wider aspect than the monitor. |
|
@Gusar321: Can you please provide me with a video that has aspect ratio 2:1 so I can fix things? (This was on the list of things I mentioned I haven't tested, mainly due lack of test material.) |
|
Just use |
|
Crash confirmed, I suspect the culrpit to be |
|
So is it basically done? |
|
Yep, I don't plan on adding anything unless someone discovers more bugs, which I'm unable to. |
|
Squashed and merged. |
This pull request introduces new video output,
vo_drm. It uses Direct Rendering Manager (DRM) and Kernel Mode Setting (KMS) to enable watching videos on Linux systems, where neither X window system nor wayland server are available. Its only dependency islibdrm(it doesn't even need OpenGL) and thus I draw a bold conclusion that in terms of dependencies, it is the most lightweight video renderer for Linux.Because of this, it doesn't use hardware acceleration at all, and heavy videos / old hardware will experience performance problems. This was tested on a 5-year-old netbook equipped with AMD C-50 (1gHz) and Radeon 6250. Old movies were played acceptably, while 720p action videos with rich ass subtitles experienced massive frame drops. This behavior could be fixed to some extent with extreme
--vf=scale=-1:180 --sws-scaler=point.I have no idea how it performs on better hardware. I'm going to purchase a powerful computer within one month.
Additionally, I (eventually) plan to develop a renderer for DRM that utilizes hardware acceleration, but it will need
libegland almost surelylibgbmthat come with their own (remarkable) chain of dependencies. In my opinion, these dependencies are what makesvo_drmattractive.