Lines Matching refs:fd
51 int fd; member
79 static void page_flip_handler(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_u…
128 drm_dev->fd = -1; in lv_linux_drm_create()
143 close(drm_dev->fd); in lv_linux_drm_set_file()
144 drm_dev->fd = -1; in lv_linux_drm_set_file()
151 close(drm_dev->fd); in lv_linux_drm_set_file()
152 drm_dev->fd = -1; in lv_linux_drm_set_file()
227 static void page_flip_handler(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_u… in page_flip_handler() argument
230 LV_UNUSED(fd); in page_flip_handler()
246 drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(drm_dev->fd, drm_dev->plane_id, in drm_get_plane_props()
255 drm_dev->plane_props[i] = drmModeGetProperty(drm_dev->fd, props->props[i]); in drm_get_plane_props()
267 drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(drm_dev->fd, drm_dev->crtc_id, in drm_get_crtc_props()
276 drm_dev->crtc_props[i] = drmModeGetProperty(drm_dev->fd, props->props[i]); in drm_get_crtc_props()
288 drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(drm_dev->fd, drm_dev->conn_id, in drm_get_conn_props()
297 drm_dev->conn_props[i] = drmModeGetProperty(drm_dev->fd, props->props[i]); in drm_get_conn_props()
393 ret = drmModeAtomicCommit(drm_dev->fd, drm_dev->req, flags, drm_dev); in drm_dmabuf_set_plane()
414 planes = drmModeGetPlaneResources(drm_dev->fd); in find_plane()
423 plane = drmModeGetPlane(drm_dev->fd, planes->planes[i]); in find_plane()
467 if((res = drmModeGetResources(drm_dev->fd)) == NULL) { in drm_find_connector()
479 conn = drmModeGetConnector(drm_dev->fd, res->connectors[i]); in drm_find_connector()
520 if(drmModeCreatePropertyBlob(drm_dev->fd, &drm_dev->mode, sizeof(drm_dev->mode), in drm_find_connector()
530 enc = drmModeGetEncoder(drm_dev->fd, res->encoders[i]); in drm_find_connector()
555 enc = drmModeGetEncoder(drm_dev->fd, conn->encoders[i]); in drm_find_connector()
617 int fd, flags; in drm_open() local
621 fd = open(path, O_RDWR); in drm_open()
622 if(fd < 0) { in drm_open()
628 if((flags = fcntl(fd, F_GETFD)) < 0 || in drm_open()
629 fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) { in drm_open()
635 ret = drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &has_dumb); in drm_open()
642 return fd; in drm_open()
644 close(fd); in drm_open()
652 drm_dev->fd = drm_open(device_path); in drm_setup()
653 if(drm_dev->fd < 0) in drm_setup()
656 ret = drmSetClientCap(drm_dev->fd, DRM_CLIENT_CAP_ATOMIC, 1); in drm_setup()
674 drm_dev->plane = drmModeGetPlane(drm_dev->fd, drm_dev->plane_id); in drm_setup()
680 drm_dev->crtc = drmModeGetCrtc(drm_dev->fd, drm_dev->crtc_id); in drm_setup()
686 drm_dev->conn = drmModeGetConnector(drm_dev->fd, drm_dev->conn_id); in drm_setup()
724 close(drm_dev->fd); in drm_setup()
740 ret = drmIoctl(drm_dev->fd, DRM_IOCTL_MODE_CREATE_DUMB, &creq); in drm_allocate_dumb()
753 ret = drmIoctl(drm_dev->fd, DRM_IOCTL_MODE_MAP_DUMB, &mreq); in drm_allocate_dumb()
763 buf->map = mmap(0, creq.size, PROT_READ | PROT_WRITE, MAP_SHARED, drm_dev->fd, mreq.offset); in drm_allocate_dumb()
776 ret = drmModeAddFB2(drm_dev->fd, drm_dev->width, drm_dev->height, drm_dev->fourcc, in drm_allocate_dumb()
807 pfd.fd = drm_dev->fd; in drm_flush_wait()
817 drmHandleEvent(drm_dev->fd, &drm_dev->drm_event_ctx); in drm_flush_wait()