Dri2 buffer format

Chia-I Wu olvaffe at gmail.com
Wed Nov 10 06:49:11 PST 2010


On Wed, Nov 10, 2010 at 10:22 PM, Jerome Glisse <j.glisse at gmail.com> wrote:
> On Tue, Nov 9, 2010 at 9:11 PM, Russell Shaw <rjshaw at netspace.net.au> wrote:
>> On 10/11/10 12:47, Kristian Høgsberg wrote:
>>>
>>> On Tue, Nov 9, 2010 at 8:43 PM, Russell Shaw<rjshaw at netspace.net.au>
>>>  wrote:
>>>>
>>>> On 10/11/10 12:32, Jesse Barnes wrote:
>>
>> ...
>>
>>>>>>> DRI2 is not mean to be use by end user application, it's only use by
>>>>>>> Xorg to comunicate with library such as opengl that want to provide
>>>>>>> direct rendering to X pixmap/window.
>>>>>>
>>>>>> Ok. How do i plot a pixel in Wayland? I'm not using
>>>>>> gtk/qt/OpenGL/OpenVG
>>>>>> etc.
>>>>>
>>>>> Allocate an shm buffer based on an mmap you've done in your client.
>>>>> Then you can draw to it and notify wayland of the damage.
>>>>
>>>> Ok. I'm already using shm buffers in X. Is there example code in wayland
>>>> of getting the shm pixel format? (i couldn't see one last time i looked)
>>>
>>> Look at the smoke.c example.
>>
>> Hi,
>> smoke.c uses cairo http://cairographics.org/
>> I don't want cairo.
>>
>> Please could i have that one bit of code for the pixel format?:)
>
> Wayland is not intended to work that way, GPU might pack pixel in strange
> format (especialy newer GPU where sometimes you can only use tiled
> buffer). The format of the buffer that GPU can understand would thus vary
> from one GPU to another, making any application which try to directly
> access pixel non portable at all.
>
> The format of the underlying buffer should thus only be understable
> by the associated GPU driver (wayland use EGL driver and in your
> app you can use another api as long as it has a driver for the GPU
> but i could only encourage anyone to stick to api such as EGL or
> cairo GL as this have proper driver for all 3 big GPU amd,intel &nividia)
Though I think it is a good idea to be able to lock/unlock a buffer
for CPU access.  It is what libkms does.  But in light of
EGL_MESA_drm_image, it could be EGL_MESA_drm_image_cpu:

  eglLockDRMImageMESA - maps an image for CPU access
  eglUnlockDRMImageMESA - unmap and flush changes
> Cheers,
> Jerome
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>



-- 
olv at LunarG.com


More information about the wayland-devel mailing list