fix permission error while running with player_test 98/158298/1
authorKwangCheol Lee <kclee@dignsys.com>
Tue, 31 Oct 2017 02:01:25 +0000 (11:01 +0900)
committerKwangCheol Lee <kclee@dignsys.com>
Tue, 31 Oct 2017 02:01:25 +0000 (11:01 +0900)
Change-Id: I1c3f5a2dbc459551ac3412d2b9277c5e79ee46f1
Signed-off-by: KwangCheol Lee <kclee@dignsys.com>
packaging/nx-video-api.spec
src/nx_video_alloc.c

index 6075878..a2df520 100644 (file)
@@ -1,5 +1,5 @@
 Name:    nx-video-api
-Version: 1.0.2
+Version: 1.0.3
 Release: 2
 License: LGPLv2+
 Summary: Nexell video APIs
index e674eec..d508d0b 100644 (file)
@@ -30,7 +30,7 @@
 #endif
 #include "nx_video_log.h"
 
-#define DRM_DEVICE_NAME "/dev/dri/card0"
+#define DRM_DEVICE_NAME "/dev/dri/renderD128"
 
 #define DRM_IOCTL_NR(n)         _IOC_NR(n)
 #define DRM_IOC_VOID            _IOC_NONE
@@ -77,7 +77,7 @@ alloc_gem (int drm_fd, int size, int flags)
 
   ret = drm_command_write_read (drm_fd, DRM_NX_GEM_CREATE, &arg, sizeof (arg));
   if (ret) {
-    _E ("drm_command_write_read\n");
+    _E ("drm_command_write_read(errno=%d, flags=%d)\n", -ret, flags);
     return ret;
   }
   //_D ("[DRM ALLOC] gem %d, size %d, flags 0x%x\n", arg.handle, size, flags);
@@ -179,7 +179,6 @@ NX_AllocateMemory (int size, int align)
   pMem->drmFd = drmFd;
   pMem->dmaFd = dmaFd;
   pMem->gemFd = gemFd;
-  pMem->flink = get_flink_name (drmFd, gemFd);
   pMem->size = size;
   pMem->align = align;
   return pMem;
@@ -296,7 +295,6 @@ NX_AllocateVideoMemory (int width, int height, int32_t planes, uint32_t format,
       dmaFd[0] = gem_to_dmafd (drmFd, gemFd[0]);
       if (dmaFd[0] < 0)
         goto ErrorExit;
-      flink[0] = get_flink_name (drmFd, gemFd[0]);
       break;
     case 2:
       //      Buffer 1
@@ -308,7 +306,6 @@ NX_AllocateVideoMemory (int width, int height, int32_t planes, uint32_t format,
       dmaFd[0] = gem_to_dmafd (drmFd, gemFd[0]);
       if (dmaFd[0] < 0)
         goto ErrorExit;
-      flink[0] = get_flink_name (drmFd, gemFd[0]);
 
       //      Buffer 2
       size[1] = cStride * cVStride * 2;
@@ -319,7 +316,6 @@ NX_AllocateVideoMemory (int width, int height, int32_t planes, uint32_t format,
       dmaFd[1] = gem_to_dmafd (drmFd, gemFd[1]);
       if (dmaFd[1] < 0)
         goto ErrorExit;
-      flink[1] = get_flink_name (drmFd, gemFd[1]);
       break;
     case 3:
       //      Buffer 1
@@ -331,7 +327,6 @@ NX_AllocateVideoMemory (int width, int height, int32_t planes, uint32_t format,
       dmaFd[0] = gem_to_dmafd (drmFd, gemFd[0]);
       if (dmaFd[0] < 0)
         goto ErrorExit;
-      flink[0] = get_flink_name (drmFd, gemFd[0]);
 
       //      Buffer 2
       size[1] = cStride * cVStride;
@@ -342,7 +337,6 @@ NX_AllocateVideoMemory (int width, int height, int32_t planes, uint32_t format,
       dmaFd[1] = gem_to_dmafd (drmFd, gemFd[1]);
       if (dmaFd[1] < 0)
         goto ErrorExit;
-      flink[1] = get_flink_name (drmFd, gemFd[1]);
 
       //      Buffer 3
       size[2] = cStride * cVStride;
@@ -353,7 +347,6 @@ NX_AllocateVideoMemory (int width, int height, int32_t planes, uint32_t format,
       dmaFd[2] = gem_to_dmafd (drmFd, gemFd[2]);
       if (dmaFd[2] < 0)
         goto ErrorExit;
-      flink[2] = get_flink_name (drmFd, gemFd[2]);
       break;
       break;
   }
@@ -380,9 +373,8 @@ NX_AllocateVideoMemory (int width, int height, int32_t planes, uint32_t format,
     pVidMem->gemFd[i] = gemFd[i];
     pVidMem->size[i] = size[i];
     pVidMem->stride[i] = stride[i];
-    pVidMem->flink[i] = flink[i];
 #ifdef TIZEN_FEATURE_ARTIK530
-    pVidMem->bo[i] = tbm_bo_import (pVidMem->bufmgr, flink[i]);
+    pVidMem->bo[i] = tbm_bo_import_fd (pVidMem->bufmgr, dmaFd[i]);
     _D ("bo[%d] = %p", i, pVidMem->bo[i]);
     if (!pVidMem->bo[i])
       goto alloc_bo_fail;