}
}
+int cros_gralloc_driver::get_fd() const {
+ return drv_get_fd(drv_);
+}
+
int32_t cros_gralloc_driver::init()
{
/*
if (asprintf(&node, str, DRM_DIR_NAME, j) < 0)
continue;
- fd = open(node, O_RDWR, 0);
+ fd = open(node, O_RDWR | O_CLOEXEC, 0);
free(node);
if (fd < 0)
return -ENODEV;
}
+int cros_gralloc_driver::init_master()
+{
+ int fd = open(DRM_DIR_NAME "/card0", O_RDWR, 0);
+ if (fd >= 0) {
+ drv_ = drv_create(fd);
+ if (drv_)
+ return 0;
+ }
+
+ return -ENODEV;
+}
+
bool cros_gralloc_driver::is_supported(const struct cros_gralloc_buffer_descriptor *descriptor)
{
struct combination *combo;