diff options
author | Marek Olšák <[email protected]> | 2019-08-27 19:35:25 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-09-09 23:43:03 -0400 |
commit | 66338631502b572594dce61ddce0406f0eaac5c3 (patch) | |
tree | ba6c65d030f06ac03b84d31380dd68dbe92d2f87 /src/gallium | |
parent | 5ac69082631d4179c268aa3decf6267f697332a4 (diff) |
r300,r600,radeonsi: set winsys_handle::stride,offset in drivers, not winsyses
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r300/r300_texture.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_texture.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_winsys.h | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_texture.c | 6 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 5 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 6 |
6 files changed, 12 insertions, 20 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 737a4f90418..f977dd14dc7 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -1049,8 +1049,10 @@ bool r300_resource_get_handle(struct pipe_screen* screen, return false; } - return rws->buffer_get_handle(rws, tex->buf, tex->tex.stride_in_bytes[0], - 0, 0, whandle); + whandle->stride = tex->tex.stride_in_bytes[0]; + whandle->offset = 0; + + return rws->buffer_get_handle(rws, tex->buf, whandle); } static const struct u_resource_vtbl r300_texture_vtbl = diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 03f217b988a..4b9b15bc0cd 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -570,8 +570,10 @@ static bool r600_texture_get_handle(struct pipe_screen* screen, res->external_usage = usage; } - return rscreen->ws->buffer_get_handle(rscreen->ws, res->buf, stride, - offset, slice_size, whandle); + whandle->stride = stride; + whandle->offset = offset + slice_size * whandle->layer; + + return rscreen->ws->buffer_get_handle(rscreen->ws, res->buf, whandle); } static void r600_texture_destroy(struct pipe_screen *screen, diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h index 505b6c9a2cb..31eed8f5300 100644 --- a/src/gallium/drivers/radeon/radeon_winsys.h +++ b/src/gallium/drivers/radeon/radeon_winsys.h @@ -412,13 +412,10 @@ struct radeon_winsys { * \param ws The winsys instance for which the handle is to be valid * \param buf A winsys buffer object to get the handle from. * \param whandle A winsys handle pointer. - * \param stride A stride of the buffer in bytes, for texturing. * \return true on success. */ bool (*buffer_get_handle)(struct radeon_winsys *ws, struct pb_buffer *buf, - unsigned stride, unsigned offset, - unsigned slice_size, struct winsys_handle *whandle); /** diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index a4a08a6e321..64fcd50f3a1 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1029,8 +1029,10 @@ static bool si_texture_get_handle(struct pipe_screen* screen, res->external_usage = usage; } - return sscreen->ws->buffer_get_handle(sscreen->ws, res->buf, stride, - offset, slice_size, whandle); + whandle->stride = stride; + whandle->offset = offset + slice_size * whandle->layer; + + return sscreen->ws->buffer_get_handle(sscreen->ws, res->buf, whandle); } static void si_texture_destroy(struct pipe_screen *screen, diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index 53f2bd67ea9..6a395967117 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -1519,8 +1519,6 @@ error: static bool amdgpu_bo_get_handle(struct radeon_winsys *rws, struct pb_buffer *buffer, - unsigned stride, unsigned offset, - unsigned slice_size, struct winsys_handle *whandle) { struct amdgpu_screen_winsys *sws = amdgpu_screen_winsys(rws); @@ -1565,9 +1563,6 @@ static bool amdgpu_bo_get_handle(struct radeon_winsys *rws, util_hash_table_set(ws->bo_export_table, bo->bo, bo); simple_mtx_unlock(&ws->bo_export_table_lock); - whandle->stride = stride; - whandle->offset = offset; - whandle->offset += slice_size * whandle->layer; 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 f8a7b89966a..c0a763d45ba 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -1274,8 +1274,6 @@ fail: static bool radeon_winsys_bo_get_handle(struct radeon_winsys *rws, struct pb_buffer *buffer, - unsigned stride, unsigned offset, - unsigned slice_size, struct winsys_handle *whandle) { struct drm_gem_flink flink; @@ -1312,10 +1310,6 @@ static bool radeon_winsys_bo_get_handle(struct radeon_winsys *rws, return false; } - whandle->stride = stride; - whandle->offset = offset; - whandle->offset += slice_size * whandle->layer; - return true; } |