summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_bo.c9
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 70993297ceb..3f74dd7da5e 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -519,7 +519,8 @@ amdgpu_bo_create(struct radeon_winsys *rws,
static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws,
struct winsys_handle *whandle,
- unsigned *stride)
+ unsigned *stride,
+ unsigned *offset)
{
struct amdgpu_winsys *ws = amdgpu_winsys(rws);
struct amdgpu_winsys_bo *bo;
@@ -587,6 +588,8 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws,
if (stride)
*stride = whandle->stride;
+ if (offset)
+ *offset = whandle->offset;
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
ws->allocated_vram += align(bo->base.size, ws->gart_page_size);
@@ -609,7 +612,7 @@ error:
}
static boolean amdgpu_bo_get_handle(struct pb_buffer *buffer,
- unsigned stride,
+ unsigned stride, unsigned offset,
struct winsys_handle *whandle)
{
struct amdgpu_winsys_bo *bo = amdgpu_winsys_bo(buffer);
@@ -637,7 +640,7 @@ static boolean amdgpu_bo_get_handle(struct pb_buffer *buffer,
return FALSE;
whandle->stride = stride;
- whandle->offset = 0;
+ whandle->offset = offset;
bo->is_shared = true;
return TRUE;
}
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 9e5d7d2e7a0..3f39827b307 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -851,7 +851,8 @@ static struct pb_buffer *radeon_winsys_bo_from_ptr(struct radeon_winsys *rws,
static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
struct winsys_handle *whandle,
- unsigned *stride)
+ unsigned *stride,
+ unsigned *offset)
{
struct radeon_drm_winsys *ws = radeon_drm_winsys(rws);
struct radeon_bo *bo;
@@ -941,6 +942,8 @@ done:
if (stride)
*stride = whandle->stride;
+ if (offset)
+ *offset = whandle->offset;
if (ws->info.has_virtual_memory && !bo->va) {
struct drm_radeon_gem_va va;
@@ -991,7 +994,7 @@ fail:
}
static boolean radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
- unsigned stride,
+ unsigned stride, unsigned offset,
struct winsys_handle *whandle)
{
struct drm_gem_flink flink;
@@ -1025,7 +1028,7 @@ static boolean radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
}
whandle->stride = stride;
- whandle->offset = 0;
+ whandle->offset = offset;
return TRUE;
}