[PATCH] compositor: allow query of surface formats.

Pekka Paalanen ppaalanen at gmail.com
Wed May 2 03:51:11 PDT 2012


On Fri, 27 Apr 2012 17:52:11 +0200
Gwenole Beauchesne <gb.devel at gmail.com> wrote:

> Hi,
> 
> Add new query to collect surface formats supported for rendering through
> surface_format events. This allows for checking whether the compositor
> supports rendering YUV buffers for example.
> 
> Note: this depends on the generic wl_buffer formats patch series. Is there
> a way to let the server fill in a wl_array instead? I am not sure this model
> that implies querying the server, iterate, and listen back for events is
> viable.

Hi,

yeah, this smells like a roundtrip to me. Can't you do it the same way
as e.g. wl_shm announces the supported formats?

Oh but I guess since you were adding formats to wl_buffer, there is no
single global object to bind to... proper review would take more time
than I can spend right now, sorry.

I would still recommend thinking about adding the formats to the buffer
factory objects (wl_shm, wl_drm) like the existing ones. We are trying
hard to avoid the "X Visuals" disaster, but I must confess, I'm not
exactly sure what that was in the first place.


Thanks,
pq

> ---
>  protocol/wayland.xml |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/protocol/wayland.xml b/protocol/wayland.xml
> index 15260f5..a09cb30 100644
> --- a/protocol/wayland.xml
> +++ b/protocol/wayland.xml
> @@ -133,6 +133,23 @@
>        </description>
>        <arg name="id" type="new_id" interface="wl_region"/>
>      </request>
> +
> +    <request name="query_surface_formats">
> +      <description summary="query surface formats">
> +        Ask the compositor to return the list of surface formats
> +        supported for rendering as several surface_format events.
> +      </description>
> +    </request>
> +
> +    <event name="surface_format">
> +      <description summary="surface format">
> +        Sent as a result of the query_surface_formats() request.
> +        This corresponds to a supported wl_buffer format for
> +        rendering.
> +      </description>
> +      <arg name="format" type="uint"
> +           summary="a wl_buffer_format"/>
> +    </event>
>    </interface>
>  
>    <interface name="wl_shm_pool" version="1">



More information about the wayland-devel mailing list