<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">pq,<br>On Fri, Apr 26, 2013 at 8:13 AM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Kristian,<br>
<br>
I'm working on Raspberry Pi, where the VideoCore can deal directly with<br>
a large number of pixel formats. However, wl_shm only exposes ARGB and<br>
XRGB 32-bit per pixel formats, which on such tiny devices are very<br>
wasteful.<br>
<br>
Would it be acceptable to add more formats to the wl_shm formats enum?<br>
I have happily forgot all the previous discussions about the topic, and<br>
a quick search into the mailing list archives didn't turn up much.<br>
<br>
We are especially interested in 16-bit per pixel formats to save memory<br>
and bandwidth, and if I am reading the GLESv2 specification right,<br>
RGB565, RGBA4444 and RGBA5551 should be directly supported, so at least<br>
those could be uploaded into textures without manual conversion. Of<br>
course, the new rpi-renderer I am working on does not use GL for<br>
compositing anymore, but it should be able to use those formats<br>
directly, too.<br></blockquote><div><br></div><div>Yeah, I think that supporting 16-bit formats would be good for any embedded application. I think Android defaults to 565 for GLES surfaces for that very reason. Particularly when working with overlays and limited space, the ability to use smaller formats is a good idea. Also, I think supporting YUV and similar would be good so that compositors could do colorspace conversions via overlays rather than software or GLSL client-side.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have also another proposition: an extension to let wl_shm support<br>
custom pixel formats outside of the core protocol listed formats.<br>
<br>
It would have a new global interface, which when bound, would advertise<br>
additional pixel formats as a (string, uint) tuple, where the string<br>
describes the pixel format, and the uint is the corresponding format<br>
name to pass into wl_shm_pool.create_buffer as the format argument.<br>
wl_shm would not advertise these format names itself. We would need to<br>
define a WL_SHM_FORMAT_CUSTOM_BASE to reserve some name space for the<br>
custom formats.<br></blockquote><div><br></div><div>Personally, I think we should prefer putting things in wl_shm over having additional formats being an extension. That said, having it extendible might not be a bad idea. It would allow for playing with new color formats without extending the core protocol and then they could be added later. That said, unless your color format is pretty exotic, I'd rather see it in wl_shm as an optional format than requiring an extension.<br>
<br></div><div>If we were to add a color format extension system, would it need to be a new interface? Why couldn't we just have an extended_formats event in wl_shm that advertises both an enum and a string? Having an extra interface to add enums to wl_shm seems a bit odd.<br>
</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Or something along those lines.<br>
<br>
Of course, this is just working around the pixel format enum wl_shm has<br>
anyway, so if you would be willing to take more exotic pixel formats<br>
into the wl_shm format enum, this extension would not be needed.<br>
<br>
Does any of this sound acceptable for upstream Wayland, or do you think<br>
we'd better just write a new wl_buffer factory with everything we need?<br>
<br>
Btw. Google found this:<br>
<a href="http://people.freedesktop.org/~krh/fourcc.patch" target="_blank">http://people.freedesktop.org/~krh/fourcc.patch</a><br>
Why was that or similar never used? :-)<br>
<br>
<br>
Thanks,<br>
pq<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div><br></div><div class="gmail_extra">Thanks,<br></div><div class="gmail_extra">--Jason Ekstrand<br></div></div>