本文整理汇总了C++中pipe_mutex_lock函数的典型用法代码示例。如果您正苦于以下问题:C++ pipe_mutex_lock函数的具体用法?C++ pipe_mutex_lock怎么用?C++ pipe_mutex_lock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pipe_mutex_lock函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rbug_context_create_surface
static struct pipe_surface *
rbug_context_create_surface(struct pipe_context *_pipe,
struct pipe_resource *_resource,
const struct pipe_surface *surf_tmpl)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct rbug_resource *rb_resource = rbug_resource(_resource);
struct pipe_context *pipe = rb_pipe->pipe;
struct pipe_resource *resource = rb_resource->resource;
struct pipe_surface *result;
pipe_mutex_lock(rb_pipe->call_mutex);
result = pipe->create_surface(pipe,
resource,
surf_tmpl);
pipe_mutex_unlock(rb_pipe->call_mutex);
if (result)
return rbug_surface_create(rb_pipe, rb_resource, result);
return NULL;
}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:21,代码来源:rbug_context.c
示例2: vlVdpOutputSurfaceGetBitsNative
/**
* Copy image data from a VdpOutputSurface to application memory in the
* surface's native format.
*/
VdpStatus
vlVdpOutputSurfaceGetBitsNative(VdpOutputSurface surface,
VdpRect const *source_rect,
void *const *destination_data,
uint32_t const *destination_pitches)
{
vlVdpOutputSurface *vlsurface;
struct pipe_context *pipe;
struct pipe_resource *res;
struct pipe_box box;
struct pipe_transfer *transfer;
uint8_t *map;
vlsurface = vlGetDataHTAB(surface);
if (!vlsurface)
return VDP_STATUS_INVALID_HANDLE;
pipe = vlsurface->device->context;
if (!pipe)
return VDP_STATUS_INVALID_HANDLE;
pipe_mutex_lock(vlsurface->device->mutex);
vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
res = vlsurface->sampler_view->texture;
box = RectToPipeBox(source_rect, res);
map = pipe->transfer_map(pipe, res, 0, PIPE_TRANSFER_READ, &box, &transfer);
if (!map) {
pipe_mutex_unlock(vlsurface->device->mutex);
return VDP_STATUS_RESOURCES;
}
util_copy_rect(*destination_data, res->format, *destination_pitches, 0, 0,
box.width, box.height, map, transfer->stride, 0, 0);
pipe_transfer_unmap(pipe, transfer);
pipe_mutex_unlock(vlsurface->device->mutex);
return VDP_STATUS_OK;
}
开发者ID:SfietKonstantin,项目名称:radeon-mesa-x86-radeon,代码行数:44,代码来源:output.c
示例3: vlVaDestroyImage
VAStatus
vlVaDestroyImage(VADriverContextP ctx, VAImageID image)
{
vlVaDriver *drv;
VAImage *vaimage;
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
drv = VL_VA_DRIVER(ctx);
pipe_mutex_lock(drv->mutex);
vaimage = handle_table_get(drv->htab, image);
if (!vaimage) {
pipe_mutex_unlock(drv->mutex);
return VA_STATUS_ERROR_INVALID_IMAGE;
}
handle_table_remove(VL_VA_DRIVER(ctx)->htab, image);
pipe_mutex_unlock(drv->mutex);
FREE(vaimage);
return vlVaDestroyBuffer(ctx, vaimage->buf);
}
开发者ID:KidGundam,项目名称:Image-Synthesis,代码行数:22,代码来源:image.c
示例4: pb_cache_manager_flush
static void
pb_cache_manager_flush(struct pb_manager *_mgr)
{
struct pb_cache_manager *mgr = pb_cache_manager(_mgr);
struct list_head *curr, *next;
struct pb_cache_buffer *buf;
pipe_mutex_lock(mgr->mutex);
curr = mgr->delayed.next;
next = curr->next;
while(curr != &mgr->delayed) {
buf = LIST_ENTRY(struct pb_cache_buffer, curr, head);
_pb_cache_buffer_destroy(buf);
curr = next;
next = curr->next;
}
pipe_mutex_unlock(mgr->mutex);
assert(mgr->provider->flush);
if(mgr->provider->flush)
mgr->provider->flush(mgr->provider);
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:22,代码来源:pb_bufmgr_cache.c
示例5: virgl_drm_resource_reference
static void virgl_drm_resource_reference(struct virgl_drm_winsys *qdws,
struct virgl_hw_res **dres,
struct virgl_hw_res *sres)
{
struct virgl_hw_res *old = *dres;
if (pipe_reference(&(*dres)->reference, &sres->reference)) {
if (!can_cache_resource(old)) {
virgl_hw_res_destroy(qdws, old);
} else {
pipe_mutex_lock(qdws->mutex);
virgl_cache_list_check_free(qdws);
old->start = os_time_get();
old->end = old->start + qdws->usecs;
LIST_ADDTAIL(&old->head, &qdws->delayed);
qdws->num_delayed++;
pipe_mutex_unlock(qdws->mutex);
}
}
*dres = sres;
}
开发者ID:BNieuwenhuizen,项目名称:mesa,代码行数:22,代码来源:virgl_drm_winsys.c
示例6: rbug_clear_render_target
static void
rbug_clear_render_target(struct pipe_context *_pipe,
struct pipe_surface *_dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
unsigned width, unsigned height)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
struct pipe_context *pipe = rb_pipe->pipe;
struct pipe_surface *dst = rb_surface_dst->surface;
pipe_mutex_lock(rb_pipe->call_mutex);
pipe->clear_render_target(pipe,
dst,
color,
dstx,
dsty,
width,
height);
pipe_mutex_unlock(rb_pipe->call_mutex);
}
开发者ID:gcampax,项目名称:mesa,代码行数:22,代码来源:rbug_context.c
示例7: pb_debug_buffer_map
static void *
pb_debug_buffer_map(struct pb_buffer *_buf,
unsigned flags)
{
struct pb_debug_buffer *buf = pb_debug_buffer(_buf);
void *map;
pb_debug_buffer_check(buf);
map = pb_map(buf->buffer, flags);
if(!map)
return NULL;
if(map) {
pipe_mutex_lock(buf->mutex);
++buf->map_count;
debug_backtrace_capture(buf->map_backtrace, 1, PB_DEBUG_MAP_BACKTRACE);
pipe_mutex_unlock(buf->mutex);
}
return (uint8_t *)map + buf->underflow_size;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:22,代码来源:pb_bufmgr_debug.c
示例8: stw_st_framebuffer_flush_front
static boolean
stw_st_framebuffer_flush_front(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfb,
enum st_attachment_type statt)
{
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
boolean ret;
HDC hDC;
pipe_mutex_lock(stwfb->fb->mutex);
/* We must not cache HDCs anywhere, as they can be invalidated by the
* application, or screen resolution changes. */
hDC = GetDC(stwfb->fb->hWnd);
ret = stw_st_framebuffer_present_locked(hDC, &stwfb->base, statt);
ReleaseDC(stwfb->fb->hWnd, hDC);
return ret;
}
开发者ID:gregory38,项目名称:mesa-sso,代码行数:22,代码来源:stw_st.c
示例9: vlVaMapBuffer
VAStatus
vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuff)
{
vlVaDriver *drv;
vlVaBuffer *buf;
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
drv = VL_VA_DRIVER(ctx);
if (!drv)
return VA_STATUS_ERROR_INVALID_CONTEXT;
if (!pbuff)
return VA_STATUS_ERROR_INVALID_PARAMETER;
pipe_mutex_lock(drv->mutex);
buf = handle_table_get(drv->htab, buf_id);
if (!buf || buf->export_refcount > 0) {
pipe_mutex_unlock(drv->mutex);
return VA_STATUS_ERROR_INVALID_BUFFER;
}
if (buf->derived_surface.resource) {
*pbuff = pipe_buffer_map(drv->pipe, buf->derived_surface.resource,
PIPE_TRANSFER_WRITE,
&buf->derived_surface.transfer);
pipe_mutex_unlock(drv->mutex);
if (!buf->derived_surface.transfer || !*pbuff)
return VA_STATUS_ERROR_INVALID_BUFFER;
} else {
pipe_mutex_unlock(drv->mutex);
*pbuff = buf->data;
}
return VA_STATUS_SUCCESS;
}
开发者ID:KidGundam,项目名称:Image-Synthesis,代码行数:39,代码来源:buffer.c
示例10: debug_malloc
void *
debug_malloc(const char *file, unsigned line, const char *function,
size_t size)
{
struct debug_memory_header *hdr;
struct debug_memory_footer *ftr;
hdr = os_malloc(sizeof(*hdr) + size + sizeof(*ftr));
if(!hdr) {
debug_printf("%s:%u:%s: out of memory when trying to allocate %lu bytes\n",
file, line, function,
(long unsigned)size);
return NULL;
}
hdr->no = last_no++;
hdr->file = file;
hdr->line = line;
hdr->function = function;
hdr->size = size;
hdr->magic = DEBUG_MEMORY_MAGIC;
hdr->tag = 0;
#if DEBUG_FREED_MEMORY
hdr->freed = FALSE;
#endif
#if DEBUG_MEMORY_STACK
debug_backtrace_capture(hdr->backtrace, 0, DEBUG_MEMORY_STACK);
#endif
ftr = footer_from_header(hdr);
ftr->magic = DEBUG_MEMORY_MAGIC;
pipe_mutex_lock(list_mutex);
LIST_ADDTAIL(&hdr->head, &list);
pipe_mutex_unlock(list_mutex);
return data_from_header(hdr);
}
开发者ID:dumbbell,项目名称:mesa,代码行数:39,代码来源:u_debug_memory.c
示例11: pb_cache_release_all_buffers
/**
* Empty the cache. Useful when there is not enough memory.
*/
void
pb_cache_release_all_buffers(struct pb_cache *mgr)
{
struct list_head *curr, *next;
struct pb_cache_entry *buf;
unsigned i;
pipe_mutex_lock(mgr->mutex);
for (i = 0; i < ARRAY_SIZE(mgr->buckets); i++) {
struct list_head *cache = &mgr->buckets[i];
curr = cache->next;
next = curr->next;
while (curr != cache) {
buf = LIST_ENTRY(struct pb_cache_entry, curr, head);
destroy_buffer_locked(buf);
curr = next;
next = curr->next;
}
}
pipe_mutex_unlock(mgr->mutex);
}
开发者ID:MIPS,项目名称:external-mesa3d,代码行数:25,代码来源:pb_cache.c
示例12: intel_winsys_decode_bo
void
intel_winsys_decode_bo(struct intel_winsys *winsys,
struct intel_bo *bo, int used)
{
void *ptr;
ptr = intel_bo_map(bo, false);
if (!ptr) {
debug_printf("failed to map buffer for decoding\n");
return;
}
pipe_mutex_lock(winsys->mutex);
if (!winsys->decode) {
winsys->decode = drm_intel_decode_context_alloc(winsys->info.devid);
if (!winsys->decode) {
pipe_mutex_unlock(winsys->mutex);
intel_bo_unmap(bo);
return;
}
/* debug_printf()/debug_error() uses stderr by default */
drm_intel_decode_set_output_file(winsys->decode, stderr);
}
/* in dwords */
used /= 4;
drm_intel_decode_set_batch_pointer(winsys->decode,
ptr, gem_bo(bo)->offset64, used);
drm_intel_decode(winsys->decode);
pipe_mutex_unlock(winsys->mutex);
intel_bo_unmap(bo);
}
开发者ID:pwnz7777,项目名称:Mesa-3D,代码行数:38,代码来源:intel_drm_winsys.c
示例13: rbug_set_framebuffer_state
static void
rbug_set_framebuffer_state(struct pipe_context *_pipe,
const struct pipe_framebuffer_state *_state)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
struct pipe_framebuffer_state unwrapped_state;
struct pipe_framebuffer_state *state = NULL;
unsigned i;
/* must protect curr status */
pipe_mutex_lock(rb_pipe->call_mutex);
rb_pipe->curr.nr_cbufs = 0;
memset(rb_pipe->curr.cbufs, 0, sizeof(rb_pipe->curr.cbufs));
rb_pipe->curr.zsbuf = NULL;
/* unwrap the input state */
if (_state) {
memcpy(&unwrapped_state, _state, sizeof(unwrapped_state));
rb_pipe->curr.nr_cbufs = _state->nr_cbufs;
for(i = 0; i < _state->nr_cbufs; i++) {
unwrapped_state.cbufs[i] = rbug_surface_unwrap(_state->cbufs[i]);
if (_state->cbufs[i])
rb_pipe->curr.cbufs[i] = rbug_resource(_state->cbufs[i]->texture);
}
unwrapped_state.zsbuf = rbug_surface_unwrap(_state->zsbuf);
if (_state->zsbuf)
rb_pipe->curr.zsbuf = rbug_resource(_state->zsbuf->texture);
state = &unwrapped_state;
}
pipe->set_framebuffer_state(pipe,
state);
pipe_mutex_unlock(rb_pipe->call_mutex);
}
开发者ID:gcampax,项目名称:mesa,代码行数:38,代码来源:rbug_context.c
示例14: vlVaQueryConfigAttributes
VAStatus
vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile *profile,
VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
{
vlVaDriver *drv;
vlVaConfig *config;
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
drv = VL_VA_DRIVER(ctx);
if (!drv)
return VA_STATUS_ERROR_INVALID_CONTEXT;
pipe_mutex_lock(drv->mutex);
config = handle_table_get(drv->htab, config_id);
pipe_mutex_unlock(drv->mutex);
if (!config)
return VA_STATUS_ERROR_INVALID_CONFIG;
*profile = PipeToProfile(config->profile);
if (config->profile == PIPE_VIDEO_PROFILE_UNKNOWN) {
*entrypoint = VAEntrypointVideoProc;
*num_attribs = 0;
return VA_STATUS_SUCCESS;
}
*entrypoint = config->entrypoint;
*num_attribs = 1;
attrib_list[0].type = VAConfigAttribRTFormat;
attrib_list[0].value = config->rt_format;
return VA_STATUS_SUCCESS;
}
开发者ID:MIPS,项目名称:external-mesa3d,代码行数:38,代码来源:config.c
示例15: lp_setup_rasterize_scene
/** Rasterize all scene's bins */
static void
lp_setup_rasterize_scene( struct lp_setup_context *setup )
{
struct lp_scene *scene = setup->scene;
struct llvmpipe_screen *screen = llvmpipe_screen(scene->pipe->screen);
scene->num_active_queries = setup->active_binned_queries;
memcpy(scene->active_queries, setup->active_queries,
scene->num_active_queries * sizeof(scene->active_queries[0]));
lp_scene_end_binning(scene);
lp_fence_reference(&setup->last_fence, scene->fence);
if (setup->last_fence)
setup->last_fence->issued = TRUE;
pipe_mutex_lock(screen->rast_mutex);
/* FIXME: We enqueue the scene then wait on the rasterizer to finish.
* This means we never actually run any vertex stuff in parallel to
* rasterization (not in the same context at least) which is what the
* multiple scenes per setup is about - when we get a new empty scene
* any old one is already empty again because we waited here for
* raster tasks to be finished. Ideally, we shouldn't need to wait here
* and rely on fences elsewhere when waiting is necessary.
* Certainly, lp_scene_end_rasterization() would need to be deferred too
* and there's probably other bits why this doesn't actually work.
*/
lp_rast_queue_scene(screen->rast, scene);
lp_rast_finish(screen->rast);
pipe_mutex_unlock(screen->rast_mutex);
lp_scene_end_rasterization(setup->scene);
lp_setup_reset( setup );
LP_DBG(DEBUG_SETUP, "%s done \n", __FUNCTION__);
}
开发者ID:BNieuwenhuizen,项目名称:mesa,代码行数:39,代码来源:lp_setup.c
示例16: svga_buffer_transfer_unmap
static void
svga_buffer_transfer_unmap( struct pipe_context *pipe,
struct pipe_transfer *transfer )
{
struct svga_screen *ss = svga_screen(pipe->screen);
struct svga_context *svga = svga_context(pipe);
struct svga_buffer *sbuf = svga_buffer(transfer->resource);
pipe_mutex_lock(ss->swc_mutex);
assert(sbuf->map.count);
if (sbuf->map.count) {
--sbuf->map.count;
}
if (svga_buffer_has_hw_storage(sbuf)) {
svga_buffer_hw_storage_unmap(svga, sbuf);
}
if (transfer->usage & PIPE_TRANSFER_WRITE) {
if (!(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT)) {
/*
* Mapped range not flushed explicitly, so flush the whole buffer,
* and tell the host to discard the contents when processing the DMA
* command.
*/
SVGA_DBG(DEBUG_DMA, "flushing the whole buffer\n");
sbuf->dma.flags.discard = TRUE;
svga_buffer_add_range(sbuf, 0, sbuf->b.b.width0);
}
}
pipe_mutex_unlock(ss->swc_mutex);
FREE(transfer);
}
开发者ID:hakzsam,项目名称:mesa,代码行数:38,代码来源:svga_resource_buffer.c
示例17: virgl_drm_screen_create
struct pipe_screen *
virgl_drm_screen_create(int fd)
{
struct pipe_screen *pscreen = NULL;
pipe_mutex_lock(virgl_screen_mutex);
if (!fd_tab) {
fd_tab = util_hash_table_create(hash_fd, compare_fd);
if (!fd_tab)
goto unlock;
}
pscreen = util_hash_table_get(fd_tab, intptr_to_pointer(fd));
if (pscreen) {
virgl_screen(pscreen)->refcnt++;
} else {
struct virgl_winsys *vws;
int dup_fd = dup(fd);
vws = virgl_drm_winsys_create(dup_fd);
pscreen = virgl_create_screen(vws);
if (pscreen) {
util_hash_table_set(fd_tab, intptr_to_pointer(dup_fd), pscreen);
/* Bit of a hack, to avoid circular linkage dependency,
* ie. pipe driver having to call in to winsys, we
* override the pipe drivers screen->destroy():
*/
virgl_screen(pscreen)->winsys_priv = pscreen->destroy;
pscreen->destroy = virgl_drm_screen_destroy;
}
}
unlock:
pipe_mutex_unlock(virgl_screen_mutex);
return pscreen;
}
开发者ID:BNieuwenhuizen,项目名称:mesa,代码行数:38,代码来源:virgl_drm_winsys.c
示例18: debug_serial
/**
* Return a small integer serial number for the given pointer.
*/
static boolean
debug_serial(void *p, unsigned *pserial)
{
unsigned serial;
boolean found = TRUE;
#ifdef PIPE_SUBSYSTEM_WINDOWS_USER
static boolean first = TRUE;
if (first) {
pipe_mutex_init(serials_mutex);
first = FALSE;
}
#endif
pipe_mutex_lock(serials_mutex);
if (!serials_hash)
serials_hash = util_hash_table_create(hash_ptr, compare_ptr);
serial = (unsigned) (uintptr_t) util_hash_table_get(serials_hash, p);
if (!serial) {
/* time to stop logging... (you'll have a 100 GB logfile at least at
* this point) TODO: avoid this
*/
serial = ++serials_last;
if (!serial) {
debug_error("More than 2^32 objects detected, aborting.\n");
os_abort();
}
util_hash_table_set(serials_hash, p, (void *) (uintptr_t) serial);
found = FALSE;
}
pipe_mutex_unlock(serials_mutex);
*pserial = serial;
return found;
}
开发者ID:MIPS,项目名称:external-mesa3d,代码行数:41,代码来源:u_debug_refcnt.c
示例19: vlVdpVideoMixerDestroy
/**
* Destroy a VdpVideoMixer.
*/
VdpStatus
vlVdpVideoMixerDestroy(VdpVideoMixer mixer)
{
vlVdpVideoMixer *vmixer;
vmixer = vlGetDataHTAB(mixer);
if (!vmixer)
return VDP_STATUS_INVALID_HANDLE;
pipe_mutex_lock(vmixer->device->mutex);
vlVdpResolveDelayedRendering(vmixer->device, NULL, NULL);
vlRemoveDataHTAB(mixer);
vl_compositor_cleanup_state(&vmixer->cstate);
if (vmixer->deint.filter) {
vl_deint_filter_cleanup(vmixer->deint.filter);
FREE(vmixer->deint.filter);
}
if (vmixer->noise_reduction.filter) {
vl_median_filter_cleanup(vmixer->noise_reduction.filter);
FREE(vmixer->noise_reduction.filter);
}
if (vmixer->sharpness.filter) {
vl_matrix_filter_cleanup(vmixer->sharpness.filter);
FREE(vmixer->sharpness.filter);
}
pipe_mutex_unlock(vmixer->device->mutex);
DeviceReference(&vmixer->device, NULL);
FREE(vmixer);
return VDP_STATUS_OK;
}
开发者ID:Unr34ler,项目名称:mesa,代码行数:41,代码来源:mixer.c
示例20: lp_setup_rasterize_scene
/** Rasterize all scene's bins */
static void
lp_setup_rasterize_scene( struct lp_setup_context *setup )
{
struct lp_scene *scene = setup->scene;
struct llvmpipe_screen *screen = llvmpipe_screen(scene->pipe->screen);
lp_scene_end_binning(scene);
lp_fence_reference(&setup->last_fence, scene->fence);
if (setup->last_fence)
setup->last_fence->issued = TRUE;
pipe_mutex_lock(screen->rast_mutex);
lp_rast_queue_scene(screen->rast, scene);
lp_rast_finish(screen->rast);
pipe_mutex_unlock(screen->rast_mutex);
lp_scene_end_rasterization(setup->scene);
lp_setup_reset( setup );
LP_DBG(DEBUG_SETUP, "%s done \n", __FUNCTION__);
}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:24,代码来源:lp_setup.c
注:本文中的pipe_mutex_lock函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论