FAILED: patch "[PATCH] drm/amdgpu: use the preferred pin domain after the check" failed to apply to 5.14-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 9deb0b3dcf13e573d54bec8498f044da9780f4e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <[email protected]>
Date: Wed, 18 Aug 2021 14:05:28 +0200
Subject: [PATCH] drm/amdgpu: use the preferred pin domain after the check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For some reason we run into an use case where a BO is already pinned into GTT, but should be pinned into VRAM|GTT again.
Handle that case gracefully as well.
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +5 -5
@@ -920,11 +920,6 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,return -EINVAL ; } -/* This assumes only APU display buffers are pinned with (VRAM|GTT). -* See function amdgpu_display_supported_domains() -*/ - domain =amdgpu_bo_get_preferred_pin_domain (adev, domain); -if (bo->tbo.pin_count) {uint32_t mem_type = bo->tbo.resource->mem_type;uint32_t mem_flags = bo->tbo.resource->placement;
@@ -949,6 +944,11 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,return 0 ; } +/* This assumes only APU display buffers are pinned with (VRAM|GTT). +* See function amdgpu_display_supported_domains() +*/ + domain =amdgpu_bo_get_preferred_pin_domain (adev, domain); +if (bo->tbo.base.import_attach)dma_buf_pin (bo->tbo.base.import_attach);