Lines Matching refs:xwl_pixmap

60 struct xwl_pixmap {  struct
134 struct xwl_pixmap *xwl_pixmap; in xwl_glamor_gbm_create_pixmap_for_bo() local
137 xwl_pixmap = malloc(sizeof *xwl_pixmap); in xwl_glamor_gbm_create_pixmap_for_bo()
138 if (xwl_pixmap == NULL) in xwl_glamor_gbm_create_pixmap_for_bo()
147 free(xwl_pixmap); in xwl_glamor_gbm_create_pixmap_for_bo()
152 xwl_pixmap->bo = bo; in xwl_glamor_gbm_create_pixmap_for_bo()
153 xwl_pixmap->buffer = NULL; in xwl_glamor_gbm_create_pixmap_for_bo()
154 xwl_pixmap->image = eglCreateImageKHR(xwl_screen->egl_display, in xwl_glamor_gbm_create_pixmap_for_bo()
157 xwl_pixmap->bo, NULL); in xwl_glamor_gbm_create_pixmap_for_bo()
158 if (xwl_pixmap->image == EGL_NO_IMAGE_KHR) in xwl_glamor_gbm_create_pixmap_for_bo()
161 glGenTextures(1, &xwl_pixmap->texture); in xwl_glamor_gbm_create_pixmap_for_bo()
162 glBindTexture(GL_TEXTURE_2D, xwl_pixmap->texture); in xwl_glamor_gbm_create_pixmap_for_bo()
166 glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, xwl_pixmap->image); in xwl_glamor_gbm_create_pixmap_for_bo()
172 glamor_set_pixmap_texture(pixmap, xwl_pixmap->texture); in xwl_glamor_gbm_create_pixmap_for_bo()
180 xwl_pixmap_set_private(pixmap, xwl_pixmap); in xwl_glamor_gbm_create_pixmap_for_bo()
185 if (xwl_pixmap->image != EGL_NO_IMAGE_KHR) in xwl_glamor_gbm_create_pixmap_for_bo()
186 eglDestroyImageKHR(xwl_screen->egl_display, xwl_pixmap->image); in xwl_glamor_gbm_create_pixmap_for_bo()
189 free(xwl_pixmap); in xwl_glamor_gbm_create_pixmap_for_bo()
249 struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); in xwl_glamor_gbm_destroy_pixmap() local
251 if (xwl_pixmap && pixmap->refcnt == 1) { in xwl_glamor_gbm_destroy_pixmap()
252 if (xwl_pixmap->buffer) in xwl_glamor_gbm_destroy_pixmap()
253 wl_buffer_destroy(xwl_pixmap->buffer); in xwl_glamor_gbm_destroy_pixmap()
255 eglDestroyImageKHR(xwl_screen->egl_display, xwl_pixmap->image); in xwl_glamor_gbm_destroy_pixmap()
256 if (xwl_pixmap->bo) in xwl_glamor_gbm_destroy_pixmap()
257 gbm_bo_destroy(xwl_pixmap->bo); in xwl_glamor_gbm_destroy_pixmap()
258 free(xwl_pixmap); in xwl_glamor_gbm_destroy_pixmap()
269 struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); in xwl_glamor_gbm_get_wl_buffer_for_pixmap() local
283 if (xwl_pixmap == NULL) in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
286 if (xwl_pixmap->buffer) { in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
290 return xwl_pixmap->buffer; in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
297 if (!xwl_pixmap->bo) in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
302 prime_fd = gbm_bo_get_fd(xwl_pixmap->bo); in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
307 num_planes = gbm_bo_get_plane_count(xwl_pixmap->bo); in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
308 modifier = gbm_bo_get_modifier(xwl_pixmap->bo); in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
310 strides[i] = gbm_bo_get_stride_for_plane(xwl_pixmap->bo, i); in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
311 offsets[i] = gbm_bo_get_offset(xwl_pixmap->bo, i); in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
316 strides[0] = gbm_bo_get_stride(xwl_pixmap->bo); in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
346 xwl_pixmap->buffer = in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
351 xwl_pixmap->buffer = in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
354 0, gbm_bo_get_stride(xwl_pixmap->bo), in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
360 return xwl_pixmap->buffer; in xwl_glamor_gbm_get_wl_buffer_for_pixmap()
546 struct xwl_pixmap *xwl_pixmap; in glamor_egl_fds_from_pixmap() local
552 xwl_pixmap = xwl_pixmap_get(pixmap); in glamor_egl_fds_from_pixmap()
554 if (xwl_pixmap == NULL) in glamor_egl_fds_from_pixmap()
557 if (!xwl_pixmap->bo) in glamor_egl_fds_from_pixmap()
561 num_fds = gbm_bo_get_plane_count(xwl_pixmap->bo); in glamor_egl_fds_from_pixmap()
562 *modifier = gbm_bo_get_modifier(xwl_pixmap->bo); in glamor_egl_fds_from_pixmap()
565 fds[i] = gbm_bo_get_fd(xwl_pixmap->bo); in glamor_egl_fds_from_pixmap()
566 strides[i] = gbm_bo_get_stride_for_plane(xwl_pixmap->bo, i); in glamor_egl_fds_from_pixmap()
567 offsets[i] = gbm_bo_get_offset(xwl_pixmap->bo, i); in glamor_egl_fds_from_pixmap()
573 fds[0] = gbm_bo_get_fd(xwl_pixmap->bo); in glamor_egl_fds_from_pixmap()
574 strides[0] = gbm_bo_get_stride(xwl_pixmap->bo); in glamor_egl_fds_from_pixmap()