dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Dave Airlie <airlied@gmail.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/5] drm/ttm: fix memcpy move bo size comparison
Date: Tue, 20 Oct 2020 10:51:08 +0200	[thread overview]
Message-ID: <11b9aba7-73bb-affa-c4d0-cb3fdfc9153f@amd.com> (raw)
In-Reply-To: <20201019222257.1684769-3-airlied@gmail.com>

You can just nuke the whole handling.

As far as I can see ttm_bo_move_memcpy() is never used with overlapping 
memory objects because those are illegal in TTM for other reasons.

Christian.

Am 20.10.20 um 00:22 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> start is in page units, so compare with pages.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index 558e78ad82aa..b31be57884ba 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -268,7 +268,7 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
>   	dir = 1;
>   
>   	if ((old_mem->mem_type == new_mem->mem_type) &&
> -	    (new_mem->start < old_mem->start + old_mem->size)) {
> +	    (new_mem->start < old_mem->start + old_mem->num_pages)) {
>   		dir = -1;
>   		add = new_mem->num_pages - 1;
>   	}

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-10-20  8:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 22:22 [PATCH 0/5] ttm fix range checks + drop some fields Dave Airlie
2020-10-19 22:22 ` [PATCH 1/5] drm/ttm: fix eviction valuable range check Dave Airlie
2020-10-20  8:46   ` Christian König
2020-10-19 22:22 ` [PATCH 2/5] drm/ttm: fix memcpy move bo size comparison Dave Airlie
2020-10-20  8:51   ` Christian König [this message]
2020-10-19 22:22 ` [PATCH 3/5] drm/ttm: drop bo->num_pages Dave Airlie
2020-10-20  3:15   ` Dave Airlie
2020-10-20  8:57   ` Christian König
2020-10-19 22:22 ` [PATCH 4/5] drm/ttm: add bo size in bytes wrapper Dave Airlie
2020-10-19 22:22 ` [PATCH 5/5] drm/ttm: get rid of storing size in ttm_resource 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=11b9aba7-73bb-affa-c4d0-cb3fdfc9153f@amd.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@gmail.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