summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_drm.c
diff options
context:
space:
mode:
authorDaniel Stone <[email protected]>2019-03-18 16:07:00 +0000
committerAlyssa Rosenzweig <[email protected]>2019-03-20 04:20:42 +0000
commitd258b787faaf9b089acd740df26bddbb64c2c630 (patch)
tree01d44535da59fa41c2a87b61905380f02c8e5e9d /src/gallium/drivers/panfrost/pan_drm.c
parent2be60e0c73ed1555a919c5725cc0cab119a2b6de (diff)
panfrost: Properly align stride
Handle buffers whose width is not aligned to 16px by padding the stride and storing it accordingly. This does not reject imports for images whose stride is not sufficiently aligned. v2: make sure bo->stride is set on imported buffers, and add missing variable definition. (Tomeu) Tested-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_drm.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_drm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c
index 71e8c6ac1f9..bc2007e6cce 100644
--- a/src/gallium/drivers/panfrost/pan_drm.c
+++ b/src/gallium/drivers/panfrost/pan_drm.c
@@ -162,7 +162,7 @@ panfrost_drm_import_bo(struct panfrost_screen *screen, struct winsys_handle *wha
}
static int
-panfrost_drm_export_bo(struct panfrost_screen *screen, int gem_handle, struct winsys_handle *whandle)
+panfrost_drm_export_bo(struct panfrost_screen *screen, int gem_handle, unsigned int stride, struct winsys_handle *whandle)
{
struct panfrost_drm *drm = (struct panfrost_drm *)screen->driver;
struct drm_prime_handle args = {
@@ -175,6 +175,7 @@ panfrost_drm_export_bo(struct panfrost_screen *screen, int gem_handle, struct wi
return FALSE;
whandle->handle = args.fd;
+ whandle->stride = stride;
return TRUE;
}