-
Notifications
You must be signed in to change notification settings - Fork 0
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
Find a working GBM + GL program (in any language) #11
Comments
Hey, thanks for finding these! I'm trying to run them too. Where does the first one fail for you exactly? This is my
|
Looking at the trace above, the first "obvious" failure I can spot is |
For me it fails with "no encoders found", which I've never seen before. I'll see if I can get it to work. But in the meantime I've tried three other programs and all fail at different points, either at FB creation or GBM surface creation. But you got pretty far in the execution, so I guess this approach is more or less correct and might be worth porting. |
Hmmm... I got pretty far in the literal sense but I wouldn't trust that snippet too much; it does no error checking whatsoever and seems to happily pass null/invalid pointers along. The issues may come from earlier than we think. But yeah, it's good to sanity check against :). |
Yeah, I don't really trust it either, it's just for inspiration :) Meanwhile, I got the encoders to work, they do not process them correctly and here's what I've got.
It looks like |
Hmm I don't think it did, unless I'm misreading. In your last trace |
Yeah, you're right. So it's the same as in my Rust code. I wonder how well GBM surfaces are supported. Glutin is using them in the GBM backend but some other apps just use framebuffers directly and don't bother with these surfaces at all. |
Yeah, no idea. Also pretty puzzling why I'll look for more well behaved examples... |
(By the way, KMSCube fails for me with the same error that you get. Interestingly using |
In your case I haven't read the |
I think we're using different definitions of failure 😄
The program carries on passing the null pointer to things that expect a surface pointer, so basically anything else in the trace after that point is undefined behaviour. |
I see, same as in my case before. I need to start reading these traces more carefully :) I just tried ltrace on kmscube and this time I think kmscube is our best bet going forward, it looks more or less polished. The other programs I've seen are toy examples that cut too many corners. |
Let me try |
So, turns out nvidia simply does not implement I'm not really sure how to use that glutin object to do something useful but that's for another issue. |
I couldn't get any program working with the So this partially resolves the issue but I'm really sad how each app breaks differently on every combination of HW + driver :( |
Oh damn, nouveau doesn't give me much confidence 😄 I don't think I've ever dealt with nouveau in a context that didn't boil down to "disable nouveau" |
True but for the moment I'm happy that at least something kind of works 😄 |
Okay I tried remotely, though I was not present to see if that draws anything on the screen 🙈. I'm using git master of https://gitlab.freedesktop.org/mesa/kmscube/ When running for the first time, it may have worked. It printed this:
Ctrl+C didn't work, so I had to shoot it down using SIGKILL from another terminal. Trying to run it afterwards always fails:
I also see related info/warns/errors in
FWIW
|
I tried to follow @strohel but I couldn't get I then loaded With |
I'm struggling a bit with the GL setup. I think it's a bit too much work to figure all these pieces from the first principles, certainly for me, so I decided to get some C program working first and then port it to Rust.
I found this [1] which looks promising but fails in encoder initialization.
I also tried kmscube [2] but that fails when adding a framebuffer with "Invalid argument".
It would be great if anyone could get either one of these or any other similar program running, so we have some real example to learn from.
[1] https://github.com/eyelash/tutorials/blob/master/drm-gbm.c
[2] https://gitlab.freedesktop.org/mesa/kmscube/
The text was updated successfully, but these errors were encountered: