All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate
@ 2018-02-22 11:15 Christian König
  2018-02-22 11:15 ` [PATCH 2/8] drm/virtio: remove ttm_pool_* wrappers Christian König
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
  To: dri-devel

Use ttm_pool_populate/ttm_pool_unpopulate if the driver doesn't provide
a function.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_tt.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 9fd7115a013a..65bf4eac184b 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -410,7 +410,10 @@ int ttm_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
 	if (ttm->state != tt_unpopulated)
 		return 0;
 
-	ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
+	if (ttm->bdev->driver->ttm_tt_populate)
+		ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
+	else
+		ret = ttm_pool_populate(ttm, ctx);
 	if (!ret)
 		ttm_tt_add_mapping(ttm);
 	return ret;
@@ -436,5 +439,8 @@ void ttm_tt_unpopulate(struct ttm_tt *ttm)
 		return;
 
 	ttm_tt_clear_mapping(ttm);
-	ttm->bdev->driver->ttm_tt_unpopulate(ttm);
+	if (ttm->bdev->driver->ttm_tt_unpopulate)
+		ttm->bdev->driver->ttm_tt_unpopulate(ttm);
+	else
+		ttm_pool_unpopulate(ttm);
 }
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-23 10:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
2018-02-22 11:15 ` [PATCH 2/8] drm/virtio: remove ttm_pool_* wrappers Christian König
2018-02-22 11:15 ` [PATCH 3/8] drm/mgag200: " Christian König
2018-02-22 11:15 ` [PATCH 4/8] drm/hisilicon: " Christian König
2018-02-22 11:15 ` [PATCH 5/8] drm/ast: " Christian König
2018-02-22 11:15 ` [PATCH 6/8] drm/qxl: " Christian König
2018-02-22 11:15 ` [PATCH 7/8] drm/cirrus: " Christian König
2018-02-22 11:15 ` [PATCH 8/8] drm/bochs: remove the default ttm_tt_populate callbacks Christian König
2018-02-23  3:27   ` He, Roger
2018-02-22 15:55 ` [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Michel Dänzer
2018-02-23  7:39   ` Christian König
2018-02-23 10:04     ` Michel Dänzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.