On 13/03/11 08:09, Dave Airlie wrote:
> On Sun, Mar 13, 2011 at 5:02 PM, Denis Oliver Kropp <[email protected]> wrote:
>> Hi,
>>
>> thanks to all of you who contributed to Mesa/DRM/KMS.
>>
>> Following are some benchmark results of the new DirectFB on Mesa port.
>>
>> The code is checked into git.directfb.org now.
>>
>>
>> I also think I know how to map the buffers now (see my previous mails),
>> using intel specific ioctl (as in libkms bo_map) with the handle returned by
>> eglExportDRMImageMESA.
>>
> 
> I don't know the right answer, but that isn't it. You really don't
> want to be using libkms at all
> for that use case I don't think. libkms buffers aren't meant to be
> used in acceleration situations.

Right, I'm not going to use libkms.

I'll stay with the Mesa based allocation, but thought I can map the bo
similar to how it is done in libkms' bo_map implementation for intel:


static int
intel_bo_map(struct kms_bo *_bo, void **out)
{
        struct intel_bo *bo = (struct intel_bo *)_bo;
        struct drm_i915_gem_mmap_gtt arg;
        void *map = NULL;
        int ret;

        if (bo->base.ptr) {
                bo->map_count++;
                *out = bo->base.ptr;
                return 0;
        }

        memset(&arg, 0, sizeof(arg));
        arg.handle = bo->base.handle;     <=== use the handle from 
eglExportDRMImageMESA here! <================

        ret = drmCommandWriteRead(bo->base.kms->fd, DRM_I915_GEM_MMAP_GTT, 
&arg, sizeof(arg));
        if (ret)
                return ret;

        map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, 
bo->base.kms->fd, arg.offset);
        if (map == MAP_FAILED)
                return -errno;

        bo->base.ptr = map;
        bo->map_count++;
        *out = bo->base.ptr;

        return 0;
}


-- 
Best regards,
  Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to