[Mesa-dev] [PATCH 1/2] gbm: Introduce a new API gbm_bo_create_from_name.

Kristian Høgsberg krh at bitplanet.net
Thu Dec 15 10:31:46 PST 2011


On Thu, Dec 15, 2011 at 11:08 AM, zhigang gong <zhigang.gong at gmail.com> wrote:
> On Thu, Dec 15, 2011 at 11:57 PM, Eric Anholt <eric at anholt.net> wrote:
>> On Thu, 15 Dec 2011 17:58:45 +0800, zhigang.gong at linux.intel.com wrote:
>>> From: Zhigang Gong <zhigang.gong at linux.intel.com>
>>>
>>> Glamor need a function to create a texture from a
>>> BO allocated by using libdrm directly in DDX layer.
>>> EGL image extension API eglCreateImageKHR does support
>>> this function, but that extension only support one
>>> colore format - ARGB32 which is not sufficent for
>>> us. I discussed this in the mail list and KRH suggest
>>> me to extent GBM to support more color formats should
>>> be better. I took his advice and decide to use gbm
>>> bo to create image. Now before extent the color formats,
>>> I have to add a new API to the create a gbo from a
>>> name. This commit is for that purpose.
>>
>> If the DDX is going to be doing the memory management, then the DRI
>> driver needs to be using the same bufmgr struct and DRI fd as the DDX so
>> you can share the handle (and thus the mapping and userland caching)
>> instead of the name.
> Looks better than just create an image from the name as the DDX and DRI
> are really running in the same process in this case. But I don't know how to
> share the DDX's bufmgr with DRI driver, and how to make a texture from
> a handle directly by using the EGL/GBM interfaces. Can you give me more hints
> about how to achieve that?  Thanks.

I think you need to make the DDX use GBM for all allocations then.

Kristian


More information about the mesa-dev mailing list