-
Notifications
You must be signed in to change notification settings - Fork 232
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
Previews show small and tiled in Davinci Resolve on A770 #736
Comments
As a bit of context for the issue, Resolve uses CL/GL sharing and I'm fairly sure the issue comes down to a disagreement between mesa and compute-runtime as to what tiling format the buffer is in (so compute side writes it in one format and the GL part displays it assuming it's another format). The details about the format are given as the "modifier" when exporting the dmabuf from mesa but ATM the only two supported case are "is zero" -> Force linear and "not zero" -> We assume that magically mesa and compute-runtime will happen to pick the same format for the same image dimensions / pixel format ... |
So would it be more likely to be on the Mesa end? I'm assuming the CL side doesn't differentiate between discrete and integrated cards but the Mesa driver would. Or is it a little of both? |
Both have special case. It's not so much a function of dedicated vs igpu, just the generation of the core, the Arch (and newer iGPU too) have different tiling modes. In CL/GL sharing the GL buffer is created first and at that point Mesa doesn't even know if that buffer is for sharing or not ... |
Just for completeness, the same behavior also effects Blackmagic's BRAW Player. |
@myownfriend what MESA version are you on? Can you reproduce the issue with 24.1 or 24.2 (git)? I was debugging around and somewhere along the line I couldn't reproduce the issue with 21.1 anymore and before we start messing with GmmLib, I'd like a confirmation that it isn't just a Mesa issue |
@Tiefseetauchner I'm on 24.0.9: the latest version of the package for Fedora 40. I don't know when they're gonna roll out 24.1 either. I was just told about |
Yeah that's what I've been doing on Manjaro Thanks for trying, while there's a extremely slim change this'll fix it, I need the sanity check lol |
@Tiefseetauchner just tried it out with 24.2(git) and it's waaay better but it's not fixed. Now the tiles are larger and longer lol |
Ok that's good Well no, on multiple levels, like, I seem tk have a broken GmmLib on mt computer But it means my theory was right and I can implement a fix... Somehow |
For the record it changed because this bug got fixed : https://gitlab.freedesktop.org/mesa/mesa/-/issues/9994 Previously the exported buffer would be reported with a modifier = 0 meaning linear even though it's not. Mesa is most likely to pick Tile4 for all images on Arc. But intel-compute-runtime picks Tile64 most likely. |
For some reason I had thought this was merged already but I guess it isn't. https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29244 I'm gonna see if I can make it work with that patch |
I'm not sure it would help because Tile64 needs an aux buffer and I think iris doesn't currently support dmabuf export of surface with aux buffers so they get converted at export time into supported formats. |
I don't understand how ... There isn't even a modifier for tile64 assigned ... |
@Tiefseetauchner If you try that patch, could you tell me what modifier you end up getting from mesa ? |
I'm gonna be home in about two hours, I'll see then |
Maybe that's why playback performance falls just short of real-time for me but it runs at real-time on Windows. |
@myownfriend So the leading theory ATM talking to devs on IRC is that in the code I posted, it ends up on the unsupported line, but if you're not running a debug build, assert are disabled so it would just return false, never set And on the intel-compute-runtime side, since all it check is if modifier is 0 or not, it would hit the "not" case and use tiling format which is Tile64, so it ends up matching by random luck (and also only if the garbage returned happens to not be 0 ...) But this would need to be confirmed with gdb. |
I get the following
(Sorry forgot how to actually debug with gdb one day I'll remember) |
It is indeed a different modifier than I got last time, but I can't make heads or tails of it. 0x7FF33A48F240 shouldn't be a valid DRM_FORMAT... |
I can confirm that that patch is the fix. I tried without and I get the error, and I don't with. So this was the issue. Sadly I will not get a contributor badge for this repo today /hj |
Yeah |
@JablonskiMateusz So looking at how to fix this properly, I need to have the ability to specify a specific tiling format when calling And that info has to get down to So do you think it's be acceptable to add a new field to the
Or do you see a better option ? EDIT: smunaut@3c13f91 This is what I'm proposing. |
Previously we just assumed that whatever tiling mode was picked by mesa will match the one picked by GMMLIB but that's not always the case and in particular on Arc and Xe it doesn't work ... Mesa picks Tile4 and GMMLIB picks Tile64 ... Fixes: intel#736 Signed-off-by: Sylvain Munaut <[email protected]>
Previously we just assumed that whatever tiling mode was picked by mesa will match the one picked by GMMLIB but that's not always the case and in particular on Arc and Xe it doesn't work ... Mesa picks Tile4 and GMMLIB picks Tile64 ... Fixes: intel#736 Signed-off-by: Sylvain Munaut <[email protected]>
Finally opened a PR to fix this since all reports I got were positive, so I forward ported it to |
Previously we just assumed that whatever tiling mode was picked by mesa will match the one picked by GMMLIB but that's not always the case and in particular on Arc and Xe it doesn't work ... Mesa picks Tile4 and GMMLIB picks Tile64 ... Fixes: intel#736 Signed-off-by: Sylvain Munaut <[email protected]>
In Davinci Resolve 18 and 19 with an A770 on Fedora, footage shows properly in the timeline and media pool but the preview in the monitor is small and tiled. This only appears to happen on discrete GPUs because people with integrated graphics don't appear to be having the same issue. I don't know for sure if it's a compute runtime issue or if it's on the Mesa end.
The text was updated successfully, but these errors were encountered: