freedreno: honor handle->offset
authorRob Clark <robclark@freedesktop.org>
Mon, 25 Apr 2016 15:47:21 +0000 (11:47 -0400)
committerRob Clark <robclark@freedesktop.org>
Mon, 25 Apr 2016 20:16:22 +0000 (16:16 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_resource.c

index 9aded3bb7fe84ce29b89006093b729025190b11b..99affc492d1a8ac077d2dfd97d67ea7ccc5bfc8d 100644 (file)
@@ -43,6 +43,8 @@
 
 #include <errno.h>
 
+/* XXX this should go away, needed for 'struct winsys_handle' */
+#include "state_tracker/drm_driver.h"
 
 static bool
 pending(struct fd_resource *rsc, enum fd_resource_status status)
@@ -637,8 +639,7 @@ fail:
 static struct pipe_resource *
 fd_resource_from_handle(struct pipe_screen *pscreen,
                const struct pipe_resource *tmpl,
-               struct winsys_handle *handle,
-                unsigned usage)
+               struct winsys_handle *handle, unsigned usage)
 {
        struct fd_resource *rsc = CALLOC_STRUCT(fd_resource);
        struct fd_resource_slice *slice = &rsc->slices[0];
@@ -669,6 +670,7 @@ fd_resource_from_handle(struct pipe_screen *pscreen,
        rsc->base.vtbl = &fd_resource_vtbl;
        rsc->cpp = util_format_get_blocksize(tmpl->format);
        slice->pitch /= rsc->cpp;
+       slice->offset = handle->offset;
 
        assert(rsc->cpp);