[PATCH 4/6 (v2)] drm/amdgpu: Refuse to pin or change acceptable domains of prime BOs to VRAM. (v2)

2017-04-02 Thread raof
From: Christopher James Halse Rogers Migration to VRAM will break the sharing, resulting in rendering on the exporting GPU never becoming visible on the importing GPU. v2: Don't pin BOs to GTT. Instead, refuse to migrate them out of GTT. Signed-off-by: Christopher James Halse Rogers --- dri

[PATCH 6/7] drm/radeon: Maintain prime import/export refcount for BOs

2017-04-02 Thread raof
From: Christopher James Halse Rogers Signed-off-by: Christopher James Halse Rogers --- drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_prime.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h

[PATCH 7/7 v2] drm/radeon: Refuse to migrate a prime BO to VRAM. (v2)

2017-04-02 Thread raof
From: Christopher James Halse Rogers BOs shared via dma-buf, either imported or exported, cannot sensibly be migrated to VRAM without breaking the dma-buf sharing. Refuse userspace requests to migrate to VRAM, ensure such BOs are not migrated during command submission, and refuse to pin them t

[PATCH 2/6 v2] drm/nouveau: Pin bos from imported dma-bufs to GTT. (v2)

2017-04-02 Thread raof
From: Christopher James Halse Rogers Attempting to migrate the bo will break the sharing of the buffer. v2: Error-check the nouveau_bo_pin call; it can fail. Signed-off-by: Christopher James Halse Rogers --- drivers/gpu/drm/nouveau/nouveau_prime.c | 6 ++ 1 file changed, 6 insertions(+)

[PATCH 2/2] drm/i915: support DRIVER_PRIME_SCANOUT.

2017-04-04 Thread raof
From: Christopher James Halse Rogers CC: intel-...@lists.freedesktop.org Signed-off-by: Christopher James Halse Rogers --- drivers/gpu/drm/i915/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c inde

[PATCH] Tell userspace if scanning out of an imported PRIME buffer is safe.

2017-04-04 Thread raof
My past set of patches fix nouveau, radeon, and amdgpu breaking dma-buf sharing when trying to scanout of an imported PRIME buffer. Driver-agnostic userspace can't safely try to scanout of such a buffer, though, because the failure-mode is that subsequent rendering isn't shown on screen. This a

[PATCH 1/2] drm: Add DRM_CAP_PRIME_SCANOUT.

2017-04-04 Thread raof
From: Christopher James Halse Rogers Until recently, on (at least) nouveau, radeon, and amdgpu attempting to scanout of an imported dma-buf would silently result in the dma-buf sharing being broken. While the hardware is capable of scanning out of imported dma-bufs (at least in some circumstan

[PATCH] Fixes for interaction of imported dma-bufs and scanout

2017-03-28 Thread raof
For nouveau, radeon, and amdgpu attempting to scanout of a bo will cause the driver to migrate it to VRAM. When the bo in question is an imported dma-buf, this results in a buffer that appears to be shared but is actually device-private. Consensus on #dri-devel seemed to be that it would be appro

[PATCH 6/6] drm/radeon: Pin bos from imported dma-bufs to GTT.

2017-03-28 Thread raof
From: Christopher James Halse Rogers Attempting to migrate the bo will break the sharing of the buffer. Signed-off-by: Christopher James Halse Rogers CC: amd-...@lists.freedesktop.org --- drivers/gpu/drm/radeon/radeon_prime.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/dri

[PATCH 3/6] drm/amdgpu: Fail fb creation from imported dma-bufs.

2017-03-28 Thread raof
From: Christopher James Halse Rogers Any use of the framebuffer will migrate it to VRAM, which is not sensible for an imported dma-buf. Signed-off-by: Christopher James Halse Rogers CC: amd-...@lists.freedesktop.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 ++ 1 file changed, 6

[PATCH 1/6] drm/nouveau: Fail fb creation from imported dma-bufs.

2017-03-28 Thread raof
From: Christopher James Halse Rogers Any use of the framebuffer will migrate it to VRAM, which is not sensible for an imported dma-buf. Signed-off-by: Christopher James Halse Rogers CC: nouv...@lists.freedesktop.org --- drivers/gpu/drm/nouveau/nouveau_display.c | 4 1 file changed, 4 ins

[PATCH 4/6] drm/amd/amdgpu: Pin bos from imported dma-bufs to GTT.

2017-03-28 Thread raof
From: Christopher James Halse Rogers Attempting to migrate the bo will break the sharing of the buffer. Signed-off-by: Christopher James Halse Rogers CC: amd-...@lists.freedesktop.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 11 +++ 1 file changed, 11 insertions(+) diff --git

[PATCH 5/6] drm/radeon: Fail fb creation from imported dma-bufs.

2017-03-28 Thread raof
From: Christopher James Halse Rogers Any use of the framebuffer will migrate it to VRAM, which is not sensible for an imported dma-buf. Signed-off-by: Christopher James Halse Rogers CC: amd-...@lists.freedesktop.org --- drivers/gpu/drm/radeon/radeon_display.c | 6 ++ 1 file changed, 6 ins

[PATCH 2/6] drm/nouveau: Pin bos from imported dma-bufs to GTT.

2017-03-28 Thread raof
From: Christopher James Halse Rogers Attempting to migrate the bo will break the sharing of the buffer. Signed-off-by: Christopher James Halse Rogers CC: nouv...@lists.freedesktop.org --- drivers/gpu/drm/nouveau/nouveau_prime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu

[PATCH v2] drm/radeon: Fail fb creation from imported dma-bufs.

2017-03-28 Thread raof
From: Christopher James Halse Rogers Any use of the framebuffer will migrate it to VRAM, which is not sensible for an imported dma-buf. v2: Use DRM_DEBUG_KMS to prevent userspace accidentally spamming dmesg. Signed-off-by: Christopher James Halse Rogers CC: amd-...@lists.freedesktop.org ---

[PATCH v2] drm/amdgpu: Fail fb creation from imported dma-bufs. (v2)

2017-03-28 Thread raof
From: Christopher James Halse Rogers Any use of the framebuffer will migrate it to VRAM, which is not sensible for an imported dma-buf. v2: Use DRM_DEBUG_KMS to prevent userspace accidentally spamming dmesg. Signed-off-by: Christopher James Halse Rogers CC: amd-...@lists.freedesktop.org ---