[PATCH 2/5] drm/ttm: fix memcpy move bo size comparison
Dave Airlie
airlied at gmail.com
Mon Oct 19 22:22:54 UTC 2020
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;
}
--
2.27.0
More information about the dri-devel
mailing list