[Mesa-dev] [PATCH 13/13] wayland: Add buffer handling and visuals for fp16 formats
Jason Ekstrand
jason at jlekstrand.net
Thu Jan 31 00:41:29 UTC 2019
On January 30, 2019 04:30:17 Daniel Stone <daniel at fooishbar.org> wrote:
> 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?)
Why not? If Weston or some other compositor is using pixman, they don't
have to advertise those formats but that shouldn't stop GL-based
compositor. They can easily enough just upload the data via glTexImage2D
and composite it just like anything else. I have no idea if there is
anyone who wants to provide HDR content via SHM but I see no reason why we
should stop them.
>
>> 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
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list