}
unsigned int real_size = -1;
- //struct drm_vc4_gem_info info = {0, };
/* Determine size of bo. The fd-to-handle ioctl really should
* return the size, but it doesn't. If we have kernel 3.12 or
*/
real_size = lseek(key, 0, SEEK_END);
- /*info.handle = gem;
- if (drmCommandWriteRead(bufmgr_vc4->fd,
- DRM_VC4_GEM_GET,
- &info,
- sizeof(struct drm_vc4_gem_info))) {
- TBM_VC4_ERROR("bo:%p Cannot get gem info from gem:%d, fd:%d (%s)\n",
- bo, gem, key, strerror(errno));
- return 0;
- }*/
-
struct drm_gem_open open_arg = {0, };
open_arg.name = name;
return 0;
}
+ struct drm_gem_close close_arg = {0, };
+ memset(&arg, 0, sizeof(close_arg));
+ close_arg.handle = open_arg.handle;
+ if (drmIoctl(bufmgr_vc4->fd, DRM_IOCTL_GEM_CLOSE, &close_arg)) {
+ TBM_VC4_ERROR("Cannot close gem_handle (%d)\n", open_arg.handle,
+ strerror(errno));
+ return 0;
+ }
+
if (real_size == -1)
real_size = open_arg.size;