Mysterious DRM format modifier preventing HEVC decode on the Pi4
I'm working to get HEVC hardware decoding to work with MPV on the Raspberry Pi 4. MPV uses eglCreateImageKHR to create mapped surfaces with EGL_LINUX_DMA_BUF_EXT. The problem I'm having is that when it comes time to do this I get EGL_BAD_MATCH presumably because of the DRM format modifier (based on what I'm understanding here https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import.txt). When I manually set this modifier to 0 the video plays, but looks like this:
The hex representation for this modifier is 0x70000000004b004 which when compared to what's found in libdrm/drm_fourcc.h doesn't match anything.
My theory for what is going on is as follows. MPV thinks that the format is NV12 but I know that it isn't. This modifier is probably what translates between NV12 and SAND8. That is why you can sort of make out the original video in some of the squares but it is all messed up.
I just need to know why this format isn't in libdrm/drm_fourcc.h and why EGL rejects it, and then I should be able to get this all working.