• Home
  • Raw
  • Download

Lines Matching full:pool

75 	struct wl_shm_pool *pool;  member
85 shm_pool_finish_resize(struct wl_shm_pool *pool) in shm_pool_finish_resize() argument
89 if (pool->size == pool->new_size) in shm_pool_finish_resize()
92 data = mremap(pool->data, pool->size, pool->new_size, MREMAP_MAYMOVE); in shm_pool_finish_resize()
94 wl_resource_post_error(pool->resource, in shm_pool_finish_resize()
100 pool->data = data; in shm_pool_finish_resize()
101 pool->size = pool->new_size; in shm_pool_finish_resize()
105 shm_pool_unref(struct wl_shm_pool *pool, bool external) in shm_pool_unref() argument
108 pool->external_refcount--; in shm_pool_unref()
109 if (pool->external_refcount == 0) in shm_pool_unref()
110 shm_pool_finish_resize(pool); in shm_pool_unref()
112 pool->internal_refcount--; in shm_pool_unref()
115 if (pool->internal_refcount + pool->external_refcount) in shm_pool_unref()
118 munmap(pool->data, pool->size); in shm_pool_unref()
119 free(pool); in shm_pool_unref()
127 if (buffer->pool) in destroy_buffer()
128 shm_pool_unref(buffer->pool, false); in destroy_buffer()
169 struct wl_shm_pool *pool = wl_resource_get_user_data(resource); in shm_pool_create_buffer() local
181 offset > pool->size - stride * height) { in shm_pool_create_buffer()
200 buffer->pool = pool; in shm_pool_create_buffer()
201 pool->internal_refcount++; in shm_pool_create_buffer()
207 shm_pool_unref(pool, false); in shm_pool_create_buffer()
220 struct wl_shm_pool *pool = wl_resource_get_user_data(resource); in destroy_pool() local
222 shm_pool_unref(pool, false); in destroy_pool()
235 struct wl_shm_pool *pool = wl_resource_get_user_data(resource); in shm_pool_resize() local
237 if (size < pool->size) { in shm_pool_resize()
240 "shrinking pool invalid"); in shm_pool_resize()
244 pool->new_size = size; in shm_pool_resize()
246 /* If the compositor has taken references on this pool it in shm_pool_resize()
249 * until the compositor finishes dereferencing the pool. in shm_pool_resize()
251 if (pool->external_refcount == 0) in shm_pool_resize()
252 shm_pool_finish_resize(pool); in shm_pool_resize()
265 struct wl_shm_pool *pool; in shm_create_pool() local
275 pool = malloc(sizeof *pool); in shm_create_pool()
276 if (pool == NULL) { in shm_create_pool()
285 pool->sigbus_is_impossible = (seals & F_SEAL_SHRINK) ? true : false; in shm_create_pool()
287 pool->sigbus_is_impossible = false; in shm_create_pool()
290 pool->internal_refcount = 1; in shm_create_pool()
291 pool->external_refcount = 0; in shm_create_pool()
292 pool->size = size; in shm_create_pool()
293 pool->new_size = size; in shm_create_pool()
294 pool->data = mmap(NULL, size, in shm_create_pool()
296 if (pool->data == MAP_FAILED) { in shm_create_pool()
305 pool->resource = in shm_create_pool()
307 if (!pool->resource) { in shm_create_pool()
309 munmap(pool->data, pool->size); in shm_create_pool()
310 free(pool); in shm_create_pool()
314 wl_resource_set_implementation(pool->resource, in shm_create_pool()
316 pool, destroy_pool); in shm_create_pool()
321 free(pool); in shm_create_pool()
403 assert(buffer->pool); in wl_shm_buffer_get_data()
405 if (!buffer->pool) in wl_shm_buffer_get_data()
408 if (buffer->pool->external_refcount && in wl_shm_buffer_get_data()
409 (buffer->pool->size != buffer->pool->new_size)) in wl_shm_buffer_get_data()
410 wl_log("Buffer address requested when its parent pool " in wl_shm_buffer_get_data()
413 return buffer->pool->data + buffer->offset; in wl_shm_buffer_get_data()
443 * of the pool.
451 assert(buffer->pool->internal_refcount + in wl_shm_buffer_ref_pool()
452 buffer->pool->external_refcount); in wl_shm_buffer_ref_pool()
454 buffer->pool->external_refcount++; in wl_shm_buffer_ref_pool()
455 return buffer->pool; in wl_shm_buffer_ref_pool()
460 * \param pool The pool object
466 * the pool will be automatically destroyed when appropriate.
472 wl_shm_pool_unref(struct wl_shm_pool *pool) in wl_shm_pool_unref() argument
474 shm_pool_unref(pool, true); in wl_shm_pool_unref()
481 * the pool then we'll uninstall the signal handler so we can in reraise_sigbus()
492 struct wl_shm_pool *pool; in sigbus_handler() local
499 pool = sigbus_data->current_pool; in sigbus_handler()
502 * the pool then the error is a real problem so we'll reraise in sigbus_handler()
504 if (pool == NULL || in sigbus_handler()
505 (char *) info->si_addr < pool->data || in sigbus_handler()
506 (char *) info->si_addr >= pool->data + pool->size) { in sigbus_handler()
514 if (mmap(pool->data, pool->size, in sigbus_handler()
567 * the SHM pool of the given buffer then the client will be sent an
585 struct wl_shm_pool *pool = buffer->pool; in wl_shm_buffer_begin_access() local
588 if (pool->sigbus_is_impossible) in wl_shm_buffer_begin_access()
603 sigbus_data->current_pool == pool); in wl_shm_buffer_begin_access()
605 sigbus_data->current_pool = pool; in wl_shm_buffer_begin_access()
623 struct wl_shm_pool *pool = buffer->pool; in wl_shm_buffer_end_access() local
626 if (pool->sigbus_is_impossible) in wl_shm_buffer_end_access()