diff options
| author | Satyajit Sahu <satyajit.sahu@amd.com> | 2018-10-04 10:19:50 +0530 |
|---|---|---|
| committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-09 21:14:31 -0700 |
| commit | ee98f4ecbeedd12f19ec7f8dccd4875acf4d0c75 (patch) | |
| tree | 14c0fe62c339ae23dc82244e99fe25e3b21ca629 /amdgpu.c | |
| parent | 617ee71c986e3a261a272e4e09d3e5b5ae908cd3 (diff) | |
| download | platform_external_minigbm-ee98f4ecbeedd12f19ec7f8dccd4875acf4d0c75.tar.gz platform_external_minigbm-ee98f4ecbeedd12f19ec7f8dccd4875acf4d0c75.tar.bz2 platform_external_minigbm-ee98f4ecbeedd12f19ec7f8dccd4875acf4d0c75.zip | |
minigbm: align width so that stride aligns to 256
map stride is bigger than the allocation stride. Currently
gralloc_lock does not consider map_stride. Align the width so
that stride get alinged to 256.
BUG=b:115946221
TEST= CtsNativeHardwareTestCases GpuColorOutputCpuRead* tests
Change-Id: I0e1ccfba4ec981702498a76fa5a0b2c662b6e728
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1242767
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Diffstat (limited to 'amdgpu.c')
| -rw-r--r-- | amdgpu.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |
