summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_resource.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2011-12-02 10:20:29 -0500
committerJerome Glisse <jglisse@redhat.com>2012-01-13 18:00:53 -0500
commitbb1f0cf3508630a9a93512c79badf8c493c46743 (patch)
tree4b71d6ab7183ae1789dcae9cd7f56d93fb9a6c6c /src/gallium/drivers/r600/r600_resource.c
parent6c2c2c5a07c81a15a89519a8a84ef7c69698903b (diff)
r600g: add support for virtual address space on cayman v11
Virtual address space put the userspace in charge of their GPU address space. It's up to userspace to bind bo into the virtual address space. Command stream can them be executed using the IB_VM chunck. This patch add support for this configuration. It doesn't remove the 64K ib size limit thought this limit can be extanded up to 1M for IB_VM chunk. v2: fix rendering v3: fix rendering when using index buffer v4: make vm conditional on kernel support add basic va management v5: catch the case when we already have va for a bo v6: agd5f: update on top of ioctl changes v7: agd5f: further ioctl updates v8: indentation cleanup + fix non cayman v9: rebase against lastest mesa + improvement from Marek & Michel v10: fix cut/paste bug v11: don't rely on updated radeon_drm.h Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_resource.c')
-rw-r--r--src/gallium/drivers/r600/r600_resource.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_resource.c b/src/gallium/drivers/r600/r600_resource.c
index f3ab3613c84..01db97ad42c 100644
--- a/src/gallium/drivers/r600/r600_resource.c
+++ b/src/gallium/drivers/r600/r600_resource.c
@@ -62,3 +62,14 @@ void r600_init_context_resource_functions(struct r600_pipe_context *r600)
r600->context.transfer_destroy = u_transfer_destroy_vtbl;
r600->context.transfer_inline_write = u_transfer_inline_write_vtbl;
}
+
+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;
+}