summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vaapi_wayland.c
Commit message (Collapse)AuthorAgeFilesLines
* vo_vaapi_wayland: remove vaapi format query as formats are never usedAaron Boxer2022-06-211-25/+2
| | | | | | | | This code was taken from the older vo_vaapi driver, which does use the vaapi format list, but the new driver has no use for these formats, as it is only interested in va surfaces that can be mapped to wl buffers. The format doesn't enter into it at all.
* vo: move wayland presentation to separate filesDudemanguy2022-06-191-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Wayland had some specific code that it used for implementing the presentation time protocol. It turns out that xorg's present extension is extremely similar, so it would be silly to duplicate this whole mess again. Factor this out to separate, independent code and introduce the mp_present struct which is used for handling the ust/msc values and some other associated values. Also, add in some helper functions so all the dirty details live specifically in present_sync. The only wayland-specific part is actually obtaining ust/msc values. Since only wayland or xorg are expected to use this, add a conditional to the build that only adds this file when either one of those are present. You may observe that sbc is completely omitted. This field existed in wayland, but was completely unused (presentation time doesn't return this). Xorg's present extension also doesn't use this so just get rid of it all together. The actual calculation is slightly altered so it is correct for our purposes. We want to get the presentation event of the last frame that was just occured (this function executes right after the buffer swap). The adjustment is to just remove the vsync_duration subtraction. Also, The overly-complicated queue approach is removed. This has no actual use in practice (on wayland or xorg). Presentation statistics are only ever used after the immediate preceding swap to update vsync timings or thrown away.
* vo_vaapi_wayland: only attach solid buffer once to main surface, on creationAaron Boxer2022-06-151-1/+1
| | | | There's no need to attach it with each frame.
* vo_vaapi_wayland: remove unnecessary subsurface sync/desync in resizeAaron Boxer2022-06-151-2/+0
| | | | | | | | resize only changes subsurface position, which is always synchronized with the parent surface. For reference, see : https://wayland-book.com/surfaces-in-depth/subsurfaces.html
* vo: move allocate_memfd method to wayland_commonAaron Boxer2022-05-301-20/+1
|
* vo_vaapi_wayland/wayland_common: code style fixesDudemanguy2022-05-301-75/+113
| | | | | | | | A bad person (AKA me) merged this stuff without paying close enough attention to the code style. Reformat this to be in-line with the rest of the wayland code and general mpv style (braces for functions on the next line, horizontally aligning arguments, some cosmetic cleanups for wayland_common.h, etc.).
* wayland: use mp_tag_str not drm_format_stringDudemanguy2022-05-301-3/+2
| | | | | | | | | | | So it turns out that mpv already has an mp_tag_str which makes a readable string out of fourccs (drm formats are these). drm_format_string, on the other hand, has a ton of baggage with having to check different libdrm versions for certain headers, adding compile-time defines (because there are no version defines in the libdrm headers), etc. It's a lot simpler to just use what mpv already has and it returns what you actually care about: i.e. is this format supported or not. Fixes https://github.com/mpv-player/mpv-build/issues/184
* vo: add new vaapi-wayland driverAaron Boxer2022-05-241-0/+401
This driver makes use of dmabuffer and viewporter interfaces to enable efficient display of vaapi surfaces, avoiding any unnecessary colour space conversion, and avoiding scaling or colour conversion using GPU shader resources.