[Mesa-dev] [RFC PATCH] GBM: Add map/unmap functions

Rob Clark robdclark at gmail.com
Thu Mar 31 12:00:29 UTC 2016


On Thu, Mar 31, 2016 at 7:13 AM, Daniel Stone <daniel at fooishbar.org> wrote:
>> +static void *
>> +_gbm_dri_bo_map(struct gbm_bo *_bo,
>> +              uint32_t x, uint32_t y,
>> +              uint32_t width, uint32_t height,
>> +              uint32_t usage)
>> +{
>> +   struct gbm_dri_device *dri = gbm_dri_device(_bo->gbm);
>> +   struct gbm_dri_bo *bo = gbm_dri_bo(_bo);
>> +
>> +   if (!dri->context)
>> +      dri->context = dri->dri2->createNewContext(dri->screen, NULL, NULL, NULL);
>
> I'm a bit wary about creating a new context - especially as this ends
> up creating a full OpenGL context - but I also don't really know what
> would end up being better than this.


so, quick thought (I'll look at the rest of the patch later in the
morning)... but at the gallium level we have context flags
(PIPE_CONTEXT_*)..  perhaps add PIPE_CONTEXT_TRANSFER (or something
like that) and plumb it through dri layer to indicate that the context
is only used for map/unmap and not rendering.  That would give drivers
a hint to skip allocating various resources not needed for
transfer_map/unmap?

BR,
-R


More information about the mesa-dev mailing list