summaryrefslogtreecommitdiffstats
path: root/amdgpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'amdgpu.c')
-rw-r--r--amdgpu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/amdgpu.c b/amdgpu.c
index 2b8d64b..75d0ef1 100644
--- a/amdgpu.c
+++ b/amdgpu.c
@@ -143,6 +143,13 @@ static int amdgpu_create_bo(struct bo *bo, uint32_t width, uint32_t height, uint
if (!combo)
return -EINVAL;
+ /* Currently Gralloc does not handle a different map_stride. So to work around,
+ * aligning the stride to 256 to make bo_stride same as map_stride. b/115946221.
+ */
+#ifdef __ANDROID__
+ uint32_t bytes_per_pixel = drv_bytes_per_pixel_from_format(format, 0);
+ width = ALIGN(width, 256 / bytes_per_pixel);
+#endif
if (combo->metadata.tiling == TILE_TYPE_DRI)
return dri_bo_create(bo, width, height, format, use_flags);