Lines Matching refs:surface

55  * Try to get a surface backing buffer from the cache
146 struct vmw_svga_winsys_surface *surface;
152 surface = CALLOC_STRUCT(vmw_svga_winsys_surface);
153 if(!surface)
156 pipe_reference_init(&surface->refcnt, 1);
157 p_atomic_set(&surface->validated, 0);
158 surface->screen = vws;
159 pipe_mutex_init(surface->mutex);
160 surface->shared = !!(usage & SVGA_SURFACE_USAGE_SHARED);
161 provider = (surface->shared) ? vws->pools.gmr : vws->pools.mob_fenced;
184 if (buffer_size < VMW_TRY_CACHED_SIZE && !surface->shared) {
187 surface->size = buffer_size;
191 surface->buf = vmw_svga_winsys_buffer_wrap(pb_buf);
192 if (surface->buf && !vmw_gmr_bufmgr_region_ptr(pb_buf, &ptr))
196 surface->sid = vmw_ioctl_gb_surface_create(vws, flags, format, usage,
200 surface->buf ? NULL :
203 if (surface->sid == SVGA3D_INVALID_ID && surface->buf) {
206 * Kernel refused to allocate a surface for us.
211 vmw_svga_winsys_buffer_destroy(sws, surface->buf);
212 surface->buf = NULL;
213 surface->sid = vmw_ioctl_gb_surface_create(vws, flags, format, usage,
217 if (surface->sid == SVGA3D_INVALID_ID)
225 if (surface->buf == NULL) {
228 surface->size = vmw_region_size(desc.region);
231 pb_buf = provider->create_buffer(provider, surface->size,
233 surface->buf = vmw_svga_winsys_buffer_wrap(pb_buf);
234 if (surface->buf == NULL) {
236 vmw_ioctl_surface_destroy(vws, surface->sid);
241 surface->sid = vmw_ioctl_surface_create(vws, flags, format, usage,
244 if(surface->sid == SVGA3D_INVALID_ID)
247 /* Best estimate for surface size, used for early flushing. */
248 surface->size = buffer_size;
249 surface->buf = NULL;
252 return svga_winsys_surface(surface);
255 if (surface->buf)
256 vmw_svga_winsys_buffer_destroy(sws, surface->buf);
258 FREE(surface);
287 /* this is a noop since surface invalidation is not needed for DMA path.
288 * DMA is enabled when guest-backed surface is not enabled or
290 * when guest-backed surface is enabled, that implies DMA is always enabled;
291 * hence, surface invalidation is not needed.
297 struct svga_winsys_surface *surface)
299 struct vmw_svga_winsys_surface *vsurf = vmw_svga_winsys_surface(surface);