From 067fb2d2a34a341706b3c2044dfec9b901fc374b Mon Sep 17 00:00:00 2001 From: Takanari Hayama Date: Fri, 11 Jul 2014 15:04:22 +0900 Subject: [PATCH] Switch from GEM to PRIME. We'll be using PRIME from now on. Change-Id: I13fd4e50c87c429d52a6754dd76e80ef311e2e1b Signed-off-by: Tony SIM --- backend_kms.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/backend_kms.c b/backend_kms.c index a7662e4..9adaeb0 100644 --- a/backend_kms.c +++ b/backend_kms.c @@ -146,30 +146,11 @@ static struct gbm_bo *gbm_kms_bo_create(struct gbm_device *gbm, bo->size = bo->base.stride * bo->base.height; - // TODO: We have to export the handle. - // drmPrimeHandleToFd() or DRM_IOCTL_GEM_FLINK - { -#if 0 - if (drmPrimeHandleToFD(dev->base.base.fd, bo->base.handle.u32, DRM_CLOEXEC, &bo->fd)) { - // export failed...anything we can do? - goto error; - } -#else - struct drm_gem_flink fl; - int ret; - - fl.handle = bo->base.handle.u32; - fl.name = 0; - - ret = drmIoctl( dev->base.base.fd, DRM_IOCTL_GEM_FLINK, &fl ); - if (ret) { - GBM_DEBUG("%s: %s: DRM_IOCTL_GEM_FLINK failed. %s\n", __FILE__, __func__, strerror(errno)); - goto error; - } - - bo->fd = fl.name; -#endif + if (drmPrimeHandleToFD(dev->base.base.fd, bo->base.handle.u32, DRM_CLOEXEC, &bo->fd)) { + GBM_DEBUG("%s: %s: drmPrimeHandleToFD() failed. %s\n", __FILE__, __func__, strerror(errno)); + goto error; } + // Map to the user space for bo_write if (usage & GBM_BO_USE_WRITE) { if (kms_bo_map(bo->bo, &bo->addr)) -- 2.7.4