From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: christian.koenig@amd.com, bskeggs@redhat.com
Subject: [PATCH 03/10] drm/radeon: cleanup ttm operation ctx usage.
Date: Wed, 23 Sep 2020 13:04:47 +1000 [thread overview]
Message-ID: <20200923030454.362731-4-airlied@gmail.com> (raw)
In-Reply-To: <20200923030454.362731-1-airlied@gmail.com>
From: Dave Airlie <airlied@redhat.com>
Just pass it around move, and remove unused pieces
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/radeon/radeon_ttm.c | 34 +++++++++++++----------------
1 file changed, 15 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 085f58e833d8..9ff8c81d7784 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -151,7 +151,7 @@ static int radeon_verify_access(struct ttm_buffer_object *bo, struct file *filp)
}
static int radeon_move_blit(struct ttm_buffer_object *bo,
- bool evict, bool no_wait_gpu,
+ bool evict,
struct ttm_resource *new_mem,
struct ttm_resource *old_mem)
{
@@ -206,11 +206,10 @@ static int radeon_move_blit(struct ttm_buffer_object *bo,
}
static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
- bool evict, bool interruptible,
- bool no_wait_gpu,
+ bool evict,
+ struct ttm_operation_ctx *ctx,
struct ttm_resource *new_mem)
{
- struct ttm_operation_ctx ctx = { interruptible, no_wait_gpu };
struct ttm_resource *old_mem = &bo->mem;
struct ttm_resource tmp_mem;
struct ttm_place placements;
@@ -227,7 +226,7 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
placements.lpfn = 0;
placements.mem_type = TTM_PL_TT;
placements.flags = TTM_PL_MASK_CACHING;
- r = ttm_bo_mem_space(bo, &placement, &tmp_mem, &ctx);
+ r = ttm_bo_mem_space(bo, &placement, &tmp_mem, ctx);
if (unlikely(r)) {
return r;
}
@@ -237,7 +236,7 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
goto out_cleanup;
}
- r = ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
+ r = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
if (unlikely(r)) {
goto out_cleanup;
}
@@ -246,22 +245,21 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
if (unlikely(r)) {
goto out_cleanup;
}
- r = radeon_move_blit(bo, true, no_wait_gpu, &tmp_mem, old_mem);
+ r = radeon_move_blit(bo, true, &tmp_mem, old_mem);
if (unlikely(r)) {
goto out_cleanup;
}
- r = ttm_bo_move_ttm(bo, &ctx, new_mem);
+ r = ttm_bo_move_ttm(bo, ctx, new_mem);
out_cleanup:
ttm_resource_free(bo, &tmp_mem);
return r;
}
static int radeon_move_ram_vram(struct ttm_buffer_object *bo,
- bool evict, bool interruptible,
- bool no_wait_gpu,
+ bool evict,
+ struct ttm_operation_ctx *ctx,
struct ttm_resource *new_mem)
{
- struct ttm_operation_ctx ctx = { interruptible, no_wait_gpu };
struct ttm_resource *old_mem = &bo->mem;
struct ttm_resource tmp_mem;
struct ttm_placement placement;
@@ -278,15 +276,15 @@ static int radeon_move_ram_vram(struct ttm_buffer_object *bo,
placements.lpfn = 0;
placements.mem_type = TTM_PL_TT;
placements.flags = TTM_PL_MASK_CACHING;
- r = ttm_bo_mem_space(bo, &placement, &tmp_mem, &ctx);
+ r = ttm_bo_mem_space(bo, &placement, &tmp_mem, ctx);
if (unlikely(r)) {
return r;
}
- r = ttm_bo_move_ttm(bo, &ctx, &tmp_mem);
+ r = ttm_bo_move_ttm(bo, ctx, &tmp_mem);
if (unlikely(r)) {
goto out_cleanup;
}
- r = radeon_move_blit(bo, true, no_wait_gpu, new_mem, old_mem);
+ r = radeon_move_blit(bo, true, new_mem, old_mem);
if (unlikely(r)) {
goto out_cleanup;
}
@@ -334,14 +332,12 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
if (old_mem->mem_type == TTM_PL_VRAM &&
new_mem->mem_type == TTM_PL_SYSTEM) {
- r = radeon_move_vram_ram(bo, evict, ctx->interruptible,
- ctx->no_wait_gpu, new_mem);
+ r = radeon_move_vram_ram(bo, evict, ctx, new_mem);
} else if (old_mem->mem_type == TTM_PL_SYSTEM &&
new_mem->mem_type == TTM_PL_VRAM) {
- r = radeon_move_ram_vram(bo, evict, ctx->interruptible,
- ctx->no_wait_gpu, new_mem);
+ r = radeon_move_ram_vram(bo, evict, ctx, new_mem);
} else {
- r = radeon_move_blit(bo, evict, ctx->no_wait_gpu,
+ r = radeon_move_blit(bo, evict,
new_mem, old_mem);
}
--
2.27.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-09-23 3:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 3:04 [PATCH 00/10] ttm driver cleanups and invert move Dave Airlie
2020-09-23 3:04 ` [PATCH 01/10] drm/radeon: kill radeon_bo_wait Dave Airlie
2020-09-23 14:34 ` Christian König
2020-09-23 3:04 ` [PATCH 02/10] drm/qxl: kill unused bo wait wrapper Dave Airlie
2020-09-23 14:35 ` Christian König
2020-09-23 3:04 ` Dave Airlie [this message]
2020-09-23 14:38 ` [PATCH 03/10] drm/radeon: cleanup ttm operation ctx usage Christian König
2020-09-23 3:04 ` [PATCH 04/10] drm/nouveau/ttm: plumb ctx through move functions Dave Airlie
2020-09-23 14:39 ` Christian König
2020-09-23 3:04 ` [PATCH 05/10] drm/ttm: add bo wait that takes a ctx wrapper Dave Airlie
2020-09-23 14:40 ` Christian König
2020-09-23 3:04 ` [PATCH 06/10] drm/ttm: handle the SYSTEM->TT path in same place as others Dave Airlie
2020-09-23 3:04 ` [PATCH 07/10] drm/amdgpu/ttm: handle tt moves properly Dave Airlie
2020-09-23 14:45 ` Christian König
2020-09-24 0:46 ` Dave Airlie
2020-09-24 2:35 ` Dave Airlie
2020-09-24 9:48 ` Christian König
2020-09-23 3:04 ` [PATCH 08/10] drm/radeon/ttm: handle ttm " Dave Airlie
2020-09-23 3:04 ` [PATCH 09/10] drm/nouveau/ttm: " Dave Airlie
2020-09-23 3:04 ` [PATCH 10/10] drm/ttm: reverse move calling pattern Dave Airlie
2020-09-23 14:45 ` Christian König
2020-09-23 20:43 ` Dave Airlie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200923030454.362731-4-airlied@gmail.com \
--to=airlied@gmail.com \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox