minigbm: Restrict 256 alignment to grunt

This workaround addresses instability on grunt devices, but is a much
larger alignment than should be required. On zork, the larger alignment
ends up triggering a check that was added in mesa 21.1, causing an
allocation failure for some use cases.

Restrict the workaround to grunt devices, which are not affected by the
new check in mesa 21.1

BUG=b:180755705
TEST=start crostini on zork

Change-Id: I15855e06edb784fbca6b1128ed260450c2c82e27
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2879313
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-05-06 17:08:27 -06:00 committed by Commit Bot
parent 87ec79bfdf
commit 8ed9b31127

View file

@ -496,6 +496,7 @@ static int amdgpu_create_bo(struct bo *bo, uint32_t width, uint32_t height, uint
uint64_t use_flags)
{
struct combination *combo;
struct amdgpu_priv *priv = bo->drv->priv;
combo = drv_get_combination(bo->drv, format, use_flags);
if (!combo)
@ -515,7 +516,7 @@ static int amdgpu_create_bo(struct bo *bo, uint32_t width, uint32_t height, uint
needs_alignment = true;
#endif
// See b/122049612
if (use_flags & (BO_USE_SCANOUT))
if (use_flags & (BO_USE_SCANOUT) && priv->dev_info.family == AMDGPU_FAMILY_CZ)
needs_alignment = true;
if (needs_alignment) {