amdgpu: Don't align stride to 512 for VCE

Aligning the stride to 512 for multiplane images seems to be problematic
for VCE, resulting in protection faults and kernel hangs.

To avoid this situation, don't apply the 512 stride alignment workaround
for bos that will be used for encoding on Stoney.

BUG=b:195623914, b:195676997, b:195025184
TEST=camera.CCAUISmoke.video_fake and camera.CCAUISmoke.video_fake pass on grunt
     CtsMediaTestCases android.media.cts.EncodeDecodeTest passes on grunt

Change-Id: I233391105c4fe1bc56d684676eb0e5813ccda9dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3097148
Tested-by: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Commit-Queue: Drew Davenport <ddavenport@chromium.org>
This commit is contained in:
Drew Davenport 2021-08-16 09:36:24 -06:00 committed by Commit Bot
parent 1f70a6be8c
commit e1178658ea

View file

@ -445,7 +445,9 @@ static int amdgpu_create_bo_linear(struct bo *bo, uint32_t width, uint32_t heigh
* 256 aligned, but it's acceptable for a short-term fix. It's probably safe for other gpu
* families, but let's restrict it to Raven and Stoney for now (b/171013552, b/190484589).
* */
if (priv->dev_info.family <= AMDGPU_FAMILY_RV && num_planes > 1)
if (num_planes > 1 &&
(priv->dev_info.family == AMDGPU_FAMILY_RV ||
(priv->dev_info.family == AMDGPU_FAMILY_CZ && !(use_flags & BO_USE_HW_VIDEO_ENCODER))))
stride = ALIGN(stride, 512);
else
stride = ALIGN(stride, 256);