Lines Matching refs:shminfo

448 hostx_create_shm_segment(xcb_shm_segment_info_t *shminfo, size_t size)  in hostx_create_shm_segment()  argument
450 shminfo->shmaddr = NULL; in hostx_create_shm_segment()
457 shminfo->shmseg = xcb_generate_id(HostX.conn); in hostx_create_shm_segment()
458 cookie = xcb_shm_create_segment(HostX.conn, shminfo->shmseg, size, TRUE); in hostx_create_shm_segment()
464 shminfo->shmaddr = in hostx_create_shm_segment()
467 if (shminfo->shmaddr == MAP_FAILED) in hostx_create_shm_segment()
468 shminfo->shmaddr = NULL; in hostx_create_shm_segment()
470 if (!shminfo->shmaddr) in hostx_create_shm_segment()
471 xcb_shm_detach(HostX.conn, shminfo->shmseg); in hostx_create_shm_segment()
477 shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0666); in hostx_create_shm_segment()
478 if (shminfo->shmid != -1) { in hostx_create_shm_segment()
479 shminfo->shmaddr = shmat(shminfo->shmid, 0, 0); in hostx_create_shm_segment()
480 if (shminfo->shmaddr == (void *)-1) { in hostx_create_shm_segment()
481 shminfo->shmaddr = NULL; in hostx_create_shm_segment()
486 shmctl(shminfo->shmid, IPC_RMID, 0); in hostx_create_shm_segment()
488 shminfo->shmseg = xcb_generate_id(HostX.conn); in hostx_create_shm_segment()
489 cookie = xcb_shm_attach_checked(HostX.conn, shminfo->shmseg, shminfo->shmid, TRUE); in hostx_create_shm_segment()
494 shmdt(shminfo->shmaddr); in hostx_create_shm_segment()
495 shminfo->shmaddr = NULL; in hostx_create_shm_segment()
501 return shminfo->shmaddr != NULL; in hostx_create_shm_segment()
505 hostx_destroy_shm_segment(xcb_shm_segment_info_t *shminfo, size_t size) in hostx_destroy_shm_segment() argument
507 xcb_shm_detach(HostX.conn, shminfo->shmseg); in hostx_destroy_shm_segment()
510 munmap(shminfo->shmaddr, size); in hostx_destroy_shm_segment()
512 shmdt(shminfo->shmaddr); in hostx_destroy_shm_segment()
514 shminfo->shmaddr = NULL; in hostx_destroy_shm_segment()
741 xcb_shm_segment_info_t shminfo; in hostx_init() local
742 if (!hostx_create_shm_segment(&shminfo, 1)) { in hostx_init()
746 hostx_destroy_shm_segment(&shminfo, 1); in hostx_init()
895 hostx_destroy_shm_segment(&scrpriv->shminfo, scrpriv->shmsize); in hostx_screen_init()
916 if (!hostx_create_shm_segment(&scrpriv->shminfo, in hostx_screen_init()
924 EPHYR_DBG("SHM segment created %p", scrpriv->shminfo.shmaddr); in hostx_screen_init()
925 scrpriv->ximg->data = scrpriv->shminfo.shmaddr; in hostx_screen_init()
1114 scrpriv->shminfo, in hostx_paint_rect()