[Mesa-dev] [PATCH 13/13] wayland: Add buffer handling and visuals for fp16 formats

Daniel Stone daniel at fooishbar.org
Wed Jan 30 12:29:40 UTC 2019


Hi Kevin,

On Mon, 28 Jan 2019 at 18:43, Kevin Strasser <kevin.strasser at intel.com> wrote:
> Set loader caps indicating that wayland can handle both rgba ordering and
> fp16 formats.
>
> NOTE: This requries libwayland to provide definitions for
> WL_SHM_FORMAT_XBGR16161616F and WL_SHM_FORMAT_ABGR16161616F

To be honest, we wouldn't be very likely to add those until at least
Pixman got support for FP16 formats. (Can you also upload those
through, e.g., TexImage2D when using GLES?)

>  static const __DRIimageLoaderExtension image_loader_extension = {
> diff --git a/src/egl/wayland/wayland-drm/wayland-drm.c b/src/egl/wayland/wayland-drm/wayland-drm.c
> index 3c6696d..9dd7fd3 100644
> --- a/src/egl/wayland/wayland-drm/wayland-drm.c
> +++ b/src/egl/wayland/wayland-drm/wayland-drm.c
> @@ -117,6 +117,8 @@ drm_create_buffer(struct wl_client *client, struct wl_resource *resource,
>          case WL_DRM_FORMAT_XRGB8888:
>          case WL_DRM_FORMAT_YUYV:
>          case WL_DRM_FORMAT_RGB565:
> +        case WL_DRM_FORMAT_ABGR16161616F:
> +        case WL_DRM_FORMAT_XBGR16161616F:
>                  break;
>          default:
>                  wl_resource_post_error(resource,
> @@ -220,6 +222,10 @@ bind_drm(struct wl_client *client, void *data, uint32_t version, uint32_t id)
>                                WL_DRM_FORMAT_XRGB8888);
>          wl_resource_post_event(resource, WL_DRM_FORMAT,
>                                 WL_DRM_FORMAT_RGB565);
> +        wl_resource_post_event(resource, WL_DRM_FORMAT,
> +                               WL_DRM_FORMAT_ABGR16161616F);
> +        wl_resource_post_event(resource, WL_DRM_FORMAT,
> +                               WL_DRM_FORMAT_XBGR16161616F);

These should only be advertised if the underlying driver actually
supports texturing from FP16.

Regardless, we try to avoid adding ~anything new to wl_drm. It would
be much better to have DRM FourCC definitions for these formats and
use them via the linux_dmabuf extension if available.

If the driver advertises DRM_FORMAT_*16161616F formats through the EGL
dmabuf format query extension, then the server will automatically
advertise them to clients and import will just work on the server side
without having to touch src/egl/wayland/wayland-drm/, which we'd
mostly prefer to be preserved in amber.

Cheers,
Daniel


More information about the mesa-dev mailing list