[Mesa-dev] [PATCH] r600g: add support for virtual address space on cayman v9

Michel Dänzer michel at daenzer.net
Mon Jan 9 23:31:23 PST 2012


On Mon, 2012-01-09 at 15:38 -0500, j.glisse at gmail.com wrote: 
> From: Jerome Glisse <jglisse at redhat.com>
> 
> 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

[...]

> diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
> index d4746ff..7b153b0 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
> +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
[...]
> +
> +static void radeon_bomgr_force_va(struct radeon_bomgr *mgr, uint64_t va, uint64_t size)
> +{
> +    pipe_mutex_lock(mgr->bo_va_mutex);
> +    if (va >= mgr->va_offset) {
> +        if (va > mgr->va_offset) {
> +            struct radeon_bo_va_hole *hole;
> +            hole = CALLOC_STRUCT(radeon_bo_va_hole);
> +            if (hole) {
> +                hole->size = va - mgr->va_offset;
> +                hole->offset = va;

hole->offset = mgr->va_offset;

Also, I was wondering if mgr->va_offset needs to be guarded against
growing beyond 1 << 40. But AFAICT that's already handled by the kernel.

The rest looks good to me.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list