Android-x86
Fork

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-minigbm: コミット

external/minigbm


コミットメタ情報

リビジョン54b51d13dec07f885be0222ae54512f4a1f0db4c (tree)
日時2020-01-27 06:43:48
作者Gurchetan Singh <gurchetansingh@chro...>
コミッターMauro Rossi

ログメッセージ

amdgpu: fix misplaced code block

We only need this workaround for DRI Android buffers, not
all buffers.

Also, we don't need this for buffers with non-SW uses.

BUG=b:117942643
TEST=compile

Change-Id: I7ea24b0dc3b040b726f6c1223c96998f078a20fc
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1300595
Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>

変更サマリ

差分

--- a/amdgpu.c
+++ b/amdgpu.c
@@ -140,15 +140,22 @@ static int amdgpu_create_bo(struct bo *bo, uint32_t width, uint32_t height, uint
140140 if (!combo)
141141 return -EINVAL;
142142
143- /* Currently Gralloc does not handle a different map_stride. So to work around,
144- * aligning the stride to 256 to make bo_stride same as map_stride. b/115946221.
145- */
143+ if (combo->metadata.tiling == TILE_TYPE_DRI) {
146144 #ifdef __ANDROID__
147- uint32_t bytes_per_pixel = drv_bytes_per_pixel_from_format(format, 0);
148- width = ALIGN(width, 256 / bytes_per_pixel);
145+ /*
146+ * Currently, the gralloc API doesn't differentiate between allocation time and map
147+ * time strides. A workaround for amdgpu DRI buffers is to always to align to 256 at
148+ * allocation time.
149+ *
150+ * See b/115946221,b/117942643
151+ */
152+ if (use_flags & (BO_USE_SW_MASK)) {
153+ uint32_t bytes_per_pixel = drv_bytes_per_pixel_from_format(format, 0);
154+ width = ALIGN(width, 256 / bytes_per_pixel);
155+ }
149156 #endif
150- if (combo->metadata.tiling == TILE_TYPE_DRI)
151157 return dri_bo_create(bo, width, height, format, use_flags);
158+ }
152159
153160 stride = drv_stride_from_format(format, width, 0);
154161 stride = ALIGN(stride,256);
旧リポジトリブラウザで表示