Merge tag 'drm-misc-next-fixes-2020-12-15' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

Short summary of fixes pull (less than what git shortlog provides):

 * dma-buf: Fix docs
 * mxsfb: Silence invalid error message
 * radeon: Fix TTM multihop

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/X9i0X9mjHN9AZGD3@linux-uq9g
This commit is contained in:
Daniel Vetter
2020-12-15 17:25:55 +01:00
4 changed files with 33 additions and 41 deletions

View File

@ -190,7 +190,7 @@ DMA Fence uABI/Sync File
Indefinite DMA Fences Indefinite DMA Fences
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
At various times &dma_fence with an indefinite time until dma_fence_wait() At various times struct dma_fence with an indefinite time until dma_fence_wait()
finishes have been proposed. Examples include: finishes have been proposed. Examples include:
* Future fences, used in HWC1 to signal when a buffer isn't used by the display * Future fences, used in HWC1 to signal when a buffer isn't used by the display

View File

@ -134,11 +134,8 @@ static int mxsfb_attach_bridge(struct mxsfb_drm_private *mxsfb)
return -ENODEV; return -ENODEV;
ret = drm_bridge_attach(&mxsfb->encoder, bridge, NULL, 0); ret = drm_bridge_attach(&mxsfb->encoder, bridge, NULL, 0);
if (ret) { if (ret)
DRM_DEV_ERROR(drm->dev, return dev_err_probe(drm->dev, ret, "Failed to attach bridge\n");
"failed to attach bridge: %d\n", ret);
return ret;
}
mxsfb->bridge = bridge; mxsfb->bridge = bridge;
@ -212,7 +209,8 @@ static int mxsfb_load(struct drm_device *drm,
ret = mxsfb_attach_bridge(mxsfb); ret = mxsfb_attach_bridge(mxsfb);
if (ret) { if (ret) {
dev_err(drm->dev, "Cannot connect bridge: %d\n", ret); if (ret != -EPROBE_DEFER)
dev_err(drm->dev, "Cannot connect bridge: %d\n", ret);
goto err_vblank; goto err_vblank;
} }

View File

@ -217,27 +217,15 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
struct ttm_resource *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
int r; int r;
if ((old_mem->mem_type == TTM_PL_SYSTEM &&
new_mem->mem_type == TTM_PL_VRAM) ||
(old_mem->mem_type == TTM_PL_VRAM &&
new_mem->mem_type == TTM_PL_SYSTEM)) {
hop->fpfn = 0;
hop->lpfn = 0;
hop->mem_type = TTM_PL_TT;
hop->flags = 0;
return -EMULTIHOP;
}
if (new_mem->mem_type == TTM_PL_TT) { if (new_mem->mem_type == TTM_PL_TT) {
r = radeon_ttm_tt_bind(bo->bdev, bo->ttm, new_mem); r = radeon_ttm_tt_bind(bo->bdev, bo->ttm, new_mem);
if (r) if (r)
return r; return r;
} }
radeon_bo_move_notify(bo, evict, new_mem);
r = ttm_bo_wait_ctx(bo, ctx); r = ttm_bo_wait_ctx(bo, ctx);
if (r) if (r)
goto fail; return r;
/* Can't move a pinned BO */ /* Can't move a pinned BO */
rbo = container_of(bo, struct radeon_bo, tbo); rbo = container_of(bo, struct radeon_bo, tbo);
@ -247,12 +235,12 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
rdev = radeon_get_rdev(bo->bdev); rdev = radeon_get_rdev(bo->bdev);
if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) {
ttm_bo_move_null(bo, new_mem); ttm_bo_move_null(bo, new_mem);
return 0; goto out;
} }
if (old_mem->mem_type == TTM_PL_SYSTEM && if (old_mem->mem_type == TTM_PL_SYSTEM &&
new_mem->mem_type == TTM_PL_TT) { new_mem->mem_type == TTM_PL_TT) {
ttm_bo_move_null(bo, new_mem); ttm_bo_move_null(bo, new_mem);
return 0; goto out;
} }
if (old_mem->mem_type == TTM_PL_TT && if (old_mem->mem_type == TTM_PL_TT &&
@ -260,31 +248,37 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
radeon_ttm_tt_unbind(bo->bdev, bo->ttm); radeon_ttm_tt_unbind(bo->bdev, bo->ttm);
ttm_resource_free(bo, &bo->mem); ttm_resource_free(bo, &bo->mem);
ttm_bo_assign_mem(bo, new_mem); ttm_bo_assign_mem(bo, new_mem);
return 0; goto out;
} }
if (!rdev->ring[radeon_copy_ring_index(rdev)].ready || if (rdev->ring[radeon_copy_ring_index(rdev)].ready &&
rdev->asic->copy.copy == NULL) { rdev->asic->copy.copy != NULL) {
/* use memcpy */ if ((old_mem->mem_type == TTM_PL_SYSTEM &&
goto memcpy; new_mem->mem_type == TTM_PL_VRAM) ||
} (old_mem->mem_type == TTM_PL_VRAM &&
new_mem->mem_type == TTM_PL_SYSTEM)) {
r = radeon_move_blit(bo, evict, new_mem, old_mem); hop->fpfn = 0;
if (r) { hop->lpfn = 0;
memcpy: hop->mem_type = TTM_PL_TT;
r = ttm_bo_move_memcpy(bo, ctx, new_mem); hop->flags = 0;
if (r) { return -EMULTIHOP;
goto fail;
} }
r = radeon_move_blit(bo, evict, new_mem, old_mem);
} else {
r = -ENODEV;
} }
if (r) {
r = ttm_bo_move_memcpy(bo, ctx, new_mem);
if (r)
return r;
}
out:
/* update statistics */ /* update statistics */
atomic64_add((u64)bo->num_pages << PAGE_SHIFT, &rdev->num_bytes_moved); atomic64_add((u64)bo->num_pages << PAGE_SHIFT, &rdev->num_bytes_moved);
radeon_bo_move_notify(bo, evict, new_mem);
return 0; return 0;
fail:
swap(*new_mem, bo->mem);
radeon_bo_move_notify(bo, false, new_mem);
swap(*new_mem, bo->mem);
return r;
} }
static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resource *mem) static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resource *mem)

View File

@ -122,7 +122,7 @@ struct dma_buf_map {
/** /**
* DMA_BUF_MAP_INIT_VADDR - Initializes struct dma_buf_map to an address in system memory * DMA_BUF_MAP_INIT_VADDR - Initializes struct dma_buf_map to an address in system memory
* @vaddr: A system-memory address * @vaddr_: A system-memory address
*/ */
#define DMA_BUF_MAP_INIT_VADDR(vaddr_) \ #define DMA_BUF_MAP_INIT_VADDR(vaddr_) \
{ \ { \