From e1178658ea6dc784d45ee6a08afb07b2e2a421b7 Mon Sep 17 00:00:00 2001 From: Drew Davenport Date: Mon, 16 Aug 2021 09:36:24 -0600 Subject: [PATCH] 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 Reviewed-by: Bas Nieuwenhuizen Commit-Queue: Drew Davenport --- amdgpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/amdgpu.c b/amdgpu.c index cf2797e..e70dd14 100644 --- a/amdgpu.c +++ b/amdgpu.c @@ -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);