Avoid calling get_radeon_bo and inline it.
x >= 4096 ? 0xffff : x * 16;
}
+static INLINE uint64_t r600_resource_va(struct pipe_screen *screen, struct pipe_resource *resource)
+{
+ struct r600_screen *rscreen = (struct r600_screen*)screen;
+ struct r600_resource *rresource = (struct r600_resource*)resource;
+
+ return rscreen->ws->buffer_get_virtual_address(rresource->cs_buf);
+}
+
#endif
r600->context.transfer_destroy = u_transfer_destroy_vtbl;
r600->context.transfer_inline_write = u_default_transfer_inline_write;
}
-
-uint64_t r600_resource_va(struct pipe_screen *screen, struct pipe_resource *resource)
-{
- struct r600_screen *rscreen = (struct r600_screen*)screen;
- struct r600_resource *rresource = (struct r600_resource*)resource;
-
- if (rresource->buf) {
- return rscreen->ws->buffer_get_virtual_address(rresource->buf);
- }
- return 0;
-}
void r600_upload_const_buffer(struct r600_context *rctx, struct r600_resource **rbuffer, uint32_t *offset);
-uint64_t r600_resource_va(struct pipe_screen *screen, struct pipe_resource *resource);
-
#endif
return TRUE;
}
-static uint64_t radeon_winsys_bo_va(struct pb_buffer *buffer)
+static uint64_t radeon_winsys_bo_va(struct radeon_winsys_cs_handle *buf)
{
- struct radeon_bo *bo = get_radeon_bo(buffer);
-
- return bo->va;
+ return ((struct radeon_bo*)buf)->va;
}
void radeon_bomgr_init_functions(struct radeon_drm_winsys *ws)
* \param buf A winsys buffer object
* \return virtual address
*/
- uint64_t (*buffer_get_virtual_address)(struct pb_buffer *buf);
+ uint64_t (*buffer_get_virtual_address)(struct radeon_winsys_cs_handle *buf);
/**************************************************************************
* Command submission.