summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorChristian König2018-02-22 12:00:05 +0100
committerAlex Deucher2018-02-27 05:09:41 +0100
commite44fcf71f4092121f24b0d1b0c613a4e9c1e84e6 (patch)
tree5a2f8e8122c0ba7d4388816894ec40889b540c50 /drivers/gpu/drm/ttm
parentdrm/amd/pp: Move common dpm check functions to hardwaremanager.c (diff)
downloadkernel-qcow2-linux-e44fcf71f4092121f24b0d1b0c613a4e9c1e84e6.tar.gz
kernel-qcow2-linux-e44fcf71f4092121f24b0d1b0c613a4e9c1e84e6.tar.xz
kernel-qcow2-linux-e44fcf71f4092121f24b0d1b0c613a4e9c1e84e6.zip
drm/ttm: add default implementations for ttm_tt_(un)populate
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> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c10
1 files 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);
}