Skip to content

WIP: [RFC] radeonsi: add query_dmabuf_modifiers function

This exposes the EGL_EXT_image_dma_buf_import_modifiers extension allowing use of eglQueryDmaBufFormatsEXT and eglQueryDmaBufModifiersEXT on radeonsi.

This is useful for determining what formats are allowed when doing a dmabuf import into EGL.

I'm not sure what the status is of modifiers support on radeonsi but this just exposes the DRM_FORMAT_MOD_LINEAR modifier (which should be supported).

I've tested this with Kodi (using some of my own patches) to allow querying the supported EGL formats that are accepted.

It would be nice if this extension was supported in kmscube (which I may work on) to allow developers to easily test it.

I'm not really expecting this to be merged but I want to use it as a means of starting a discussion about modifiers on radeonsi and the merits of the EGL_EXT_image_dma_buf_import_modifiers extension in general.

example output from Kodi (with my own patches)

2019-04-20 11:12:11.142 T:140204264331648   DEBUG: CEGLImage::IsFormatSupported - supported EGL image formats and modifiers:
                                            AR30: 0
                                            XR30: 0
                                            AB30: 0
                                            XB30: 0
                                            AR24: 0
                                            AB24: 0
                                            XR24: 0
                                            XB24: 0
                                            AR15: 0
                                            RG16: 0
                                            R8  : 0
                                            R16 : 0
                                            GR88: 0
                                            GR32: 0

So here we can assume because R8 and RG16 are supported we can import NV12 and YU12 as emulated formats into EGL. It would be nice if we could expose NV12 and YV12 directly to the is_format_supported list but I don't know if that would be allowed or not.

the etnaviv query_dmabuf_modifiers function was used as a template for this.

Merge request reports