external/minigbm
修订版 | 8b68e2a1121c2075cf72ce2da02cd82bd39d14a7 (tree) |
---|---|
时间 | 2020-01-27 06:48:04 |
作者 | Satyajit Sahu <satyajit.sahu@amd....> |
Commiter | Mauro Rossi |
minigbm:amdgpu: align stride to 256
Previously stride was alinged to 256 only in linear path and
android. Now it is aligned to 256 for all cases.
BUG=b:122049612
TEST=suspend_stress_test
Change-Id: I757f2d056176fe5ebfd858a017273cf02bad6020
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1457777
Tested-by: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
@@ -140,6 +140,7 @@ static int amdgpu_create_bo(struct bo *bo, uint32_t width, uint32_t height, uint | ||
140 | 140 | return -EINVAL; |
141 | 141 | |
142 | 142 | if (combo->metadata.tiling == TILE_TYPE_DRI) { |
143 | + bool needs_alignment = false; | |
143 | 144 | #ifdef __ANDROID__ |
144 | 145 | /* |
145 | 146 | * Currently, the gralloc API doesn't differentiate between allocation time and map |
@@ -148,11 +149,18 @@ static int amdgpu_create_bo(struct bo *bo, uint32_t width, uint32_t height, uint | ||
148 | 149 | * |
149 | 150 | * See b/115946221,b/117942643 |
150 | 151 | */ |
151 | - if (use_flags & (BO_USE_SW_MASK)) { | |
152 | + if (use_flags & (BO_USE_SW_MASK)) | |
153 | + needs_alignment = true; | |
154 | +#endif | |
155 | + // See b/122049612 | |
156 | + if (use_flags & (BO_USE_SCANOUT)) | |
157 | + needs_alignment = true; | |
158 | + | |
159 | + if (needs_alignment) { | |
152 | 160 | uint32_t bytes_per_pixel = drv_bytes_per_pixel_from_format(format, 0); |
153 | 161 | width = ALIGN(width, 256 / bytes_per_pixel); |
154 | 162 | } |
155 | -#endif | |
163 | + | |
156 | 164 | return dri_bo_create(bo, width, height, format, use_flags); |
157 | 165 | } |
158 | 166 |