[Mesa-dev] About MESA drm image extension

zhigang gong zhigang.gong at gmail.com
Tue Dec 6 06:20:43 PST 2011


2011/12/5 Kristian Høgsberg <krh at bitplanet.net>:
> 2011/12/5 zhigang gong <zhigang.gong at gmail.com>:
>> Hi Kristian,
>>
>> I'm integrating glamor with intel's video driver now. The basic idea
>> is to allocate a BO
>>  by calling libdrm directly in intel uxa code path, then latter create
>> an EGL image from
>> that BO's handle. And then bind the image to a texture then glamor can
>> use it as usual.
>>
>> Now the problem is that per the spec, EGL_MESA_drm_image extension only support
>> one format,   EGL_DRM_BUFFER_FORMAT_ARGB32_MESA which has a 32bit depth.
>>
>> But a normal pixmap may has 8 or 16 bit depth color format, thus we can't get a
>> correct format image.
>>
>> Would you like to extent the MESA drm image extension to support more formats?
>> If so, then I can contribute on that including implement it in mesa.
>> Or do you have any
>> suggestion for my issues. Thanks.
>
> I think we should try to use libgbm instead of EGL_MESA_drm_image.  We
> can add more formats to gbm if that helps.
I know that libgbm should be the preferred method to allocate drm
buffers in MESA.
But this is a little special case. The buffer object is allocated in
intel video driver by
calling libdrm directly. And we need to create a KHR image from that
BO. Currently,
the only avialable method is to use eglCreateImageKHR with
EGL_DRM_BUFFER_MESA target. And thus I met the format limitation with that
target.

If libgbm can provide a new API as below:

gbm_bo_create_from_name(struct gbm_device *gbm, int name,
                                               int width, int height,
enum gbm_bo_format format,
                                               uint32_t usage)

The name is a BO's name which is allocated by libdrm.

And then extent gbm_bo_format to meet my requirement, then that will be perfect
for me.

copy to Benjamin, any comments?

Thanks.
-- Zhigang

>
> Kristian


More information about the mesa-dev mailing list