[PATCH 2/5] drm/ttm: fix memcpy move bo size comparison
Christian König
christian.koenig at amd.com
Tue Oct 20 08:51:08 UTC 2020
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 at redhat.com>
>
> start is in page units, so compare with pages.
>
> Signed-off-by: Dave Airlie <airlied at 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;
> }
More information about the dri-devel
mailing list