Skip to contentSkip to conversation

drm/ttm: Handle in memory region copies

PATCH In review Jakob Bornecrantz 2 participants 2 messages Oct 18, 2013 – Oct 30, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: Handle in memory region copies

---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo_util.c +3 -1
index 8be35c8..037f101 100644
@@ -342,7 +342,9 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
 	if (old_iomap == NULL && ttm == NULL)
 		goto out2;
 
-	if (ttm->state == tt_unpopulated) {
+	/* TTM might be null for moves within the same region.
+	 */
+	if (ttm && ttm->state == tt_unpopulated) {
 		ret = ttm->bdev->driver->ttm_tt_populate(ttm);
 		if (ret) {
 			/* if we fail here don't nuke the mm node
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 14 lines · Jakob Bornecrantz
---
  drivers/gpu/drm/ttm/ttm_bo_util.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo_util.c +0 -0
index 8be35c8..037f101 100644

drivers/gpu/drm/ttm/ttm_bo_util.c int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, · line 350

Quoted 10 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +3 -1
@@ -342,7 +342,9 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
  	if (old_iomap == NULL && ttm == NULL)
  		goto out2;
 
-	if (ttm->state == tt_unpopulated) {
+	/* TTM might be null for moves within the same region.
+	 */
+	if (ttm && ttm->state == tt_unpopulated) {
  		ret = ttm->bdev->driver->ttm_tt_populate(ttm);
  		if (ret) {
  			/* if we fail here don't nuke the mm node

LGTM. There are a couple of other fixes needed in this function as well.

/Thomas
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel