summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r300/r300_texture.c6
-rw-r--r--src/gallium/drivers/r600/r600_texture.c18
-rw-r--r--src/gallium/drivers/radeon/radeon_winsys.h4
-rw-r--r--src/gallium/drivers/radeonsi/si_texture.c15
4 files changed, 18 insertions, 25 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 689341644fd..737a4f90418 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -36,6 +36,7 @@
#include "util/u_memory.h"
#include "pipe/p_screen.h"
+#include "state_tracker/winsys_handle.h"
/* These formats are supported by swapping their bytes.
* The swizzles must be set exactly like their non-swapped counterparts,
@@ -1179,7 +1180,6 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen,
struct r300_screen *rscreen = r300_screen(screen);
struct radeon_winsys *rws = rscreen->rws;
struct pb_buffer *buffer;
- unsigned stride;
struct radeon_bo_metadata tiling = {};
/* Support only 2D textures without mipmaps */
@@ -1190,7 +1190,7 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen,
return NULL;
}
- buffer = rws->buffer_from_handle(rws, whandle, 0, &stride, NULL);
+ buffer = rws->buffer_from_handle(rws, whandle, 0);
if (!buffer)
return NULL;
@@ -1212,7 +1212,7 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen,
return (struct pipe_resource*)
r300_texture_create_object(rscreen, base, tiling.u.legacy.microtile, tiling.u.legacy.macrotile,
- stride, buffer);
+ whandle->stride, buffer);
}
/* Not required to implement u_resource_vtbl, consider moving to another file:
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index ddee3d9b833..03f217b988a 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -33,6 +33,7 @@
#include "util/u_pack_color.h"
#include "util/u_surface.h"
#include "util/os_time.h"
+#include "state_tracker/winsys_handle.h"
#include <errno.h>
#include <inttypes.h>
@@ -1115,7 +1116,6 @@ static struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen
{
struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
struct pb_buffer *buf = NULL;
- unsigned stride = 0, offset = 0;
enum radeon_surf_mode array_mode;
struct radeon_surf surface = {};
int r;
@@ -1129,8 +1129,7 @@ static struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen
return NULL;
buf = rscreen->ws->buffer_from_handle(rscreen->ws, whandle,
- rscreen->info.max_alignment,
- &stride, &offset);
+ rscreen->info.max_alignment);
if (!buf)
return NULL;
@@ -1138,8 +1137,9 @@ static struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen
r600_surface_import_metadata(rscreen, &surface, &metadata,
&array_mode, &is_scanout);
- r = r600_init_surface(rscreen, &surface, templ, array_mode, stride,
- offset, true, is_scanout, false);
+ r = r600_init_surface(rscreen, &surface, templ, array_mode,
+ whandle->stride, whandle->offset,
+ true, is_scanout, false);
if (r) {
return NULL;
}
@@ -1865,14 +1865,12 @@ r600_memobj_from_handle(struct pipe_screen *screen,
struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
struct r600_memory_object *memobj = CALLOC_STRUCT(r600_memory_object);
struct pb_buffer *buf = NULL;
- uint32_t stride, offset;
if (!memobj)
return NULL;
buf = rscreen->ws->buffer_from_handle(rscreen->ws, whandle,
- rscreen->info.max_alignment,
- &stride, &offset);
+ rscreen->info.max_alignment);
if (!buf) {
free(memobj);
return NULL;
@@ -1880,8 +1878,8 @@ r600_memobj_from_handle(struct pipe_screen *screen,
memobj->b.dedicated = dedicated;
memobj->buf = buf;
- memobj->stride = stride;
- memobj->offset = offset;
+ memobj->stride = whandle->stride;
+ memobj->offset = whandle->offset;
return (struct pipe_memory_object *)memobj;
diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h
index 525c28182ed..505b6c9a2cb 100644
--- a/src/gallium/drivers/radeon/radeon_winsys.h
+++ b/src/gallium/drivers/radeon/radeon_winsys.h
@@ -378,12 +378,10 @@ struct radeon_winsys {
* \param ws The winsys this function is called from.
* \param whandle A winsys handle pointer as was received from a state
* tracker.
- * \param stride The returned buffer stride in bytes.
*/
struct pb_buffer *(*buffer_from_handle)(struct radeon_winsys *ws,
struct winsys_handle *whandle,
- unsigned vm_alignment,
- unsigned *stride, unsigned *offset);
+ unsigned vm_alignment);
/**
* Get a winsys buffer from a user pointer. The resulting buffer can't
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c
index cb239c3a6e6..a4a08a6e321 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -1792,7 +1792,6 @@ static struct pipe_resource *si_texture_from_handle(struct pipe_screen *screen,
{
struct si_screen *sscreen = (struct si_screen*)screen;
struct pb_buffer *buf = NULL;
- unsigned stride = 0, offset = 0;
/* Support only 2D textures without mipmaps */
if ((templ->target != PIPE_TEXTURE_2D && templ->target != PIPE_TEXTURE_RECT &&
@@ -1801,13 +1800,13 @@ static struct pipe_resource *si_texture_from_handle(struct pipe_screen *screen,
return NULL;
buf = sscreen->ws->buffer_from_handle(sscreen->ws, whandle,
- sscreen->info.max_alignment,
- &stride, &offset);
+ sscreen->info.max_alignment);
if (!buf)
return NULL;
- return si_texture_from_winsys_buffer(sscreen, templ, buf, stride,
- offset, usage, true);
+ return si_texture_from_winsys_buffer(sscreen, templ, buf,
+ whandle->stride, whandle->offset,
+ usage, true);
}
bool si_init_flushed_depth_texture(struct pipe_context *ctx,
@@ -2614,14 +2613,12 @@ si_memobj_from_handle(struct pipe_screen *screen,
struct si_screen *sscreen = (struct si_screen*)screen;
struct si_memory_object *memobj = CALLOC_STRUCT(si_memory_object);
struct pb_buffer *buf = NULL;
- uint32_t stride, offset;
if (!memobj)
return NULL;
buf = sscreen->ws->buffer_from_handle(sscreen->ws, whandle,
- sscreen->info.max_alignment,
- &stride, &offset);
+ sscreen->info.max_alignment);
if (!buf) {
free(memobj);
return NULL;
@@ -2629,7 +2626,7 @@ si_memobj_from_handle(struct pipe_screen *screen,
memobj->b.dedicated = dedicated;
memobj->buf = buf;
- memobj->stride = stride;
+ memobj->stride = whandle->stride;
return (struct pipe_memory_object *)memobj;