drm/ttm: fix return value check
Subsystems (3)
PATCH 1/2 drm/ttm: fix return value check
The function returns the number of swapped pages here. Only abort when we get a negative error code.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/ttm/ttm_tt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_tt.c +1 -1
@@ -326,7 +326,7 @@ int ttm_tt_populate(struct ttm_device *bdev, ttm_dma32_pages_limit) { ret =ttm_global_swapout (ctx,GFP_KERNEL ); -if (ret) +if (ret <0 ) goto error; }
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm/ttm: re-add debugs tt_shrink file
That got lost when we moved back to a static limit.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/ttm/ttm_tt.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/gpu/drm/ttm/ttm_tt.c +20 -0
@@ -389,6 +389,21 @@ void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm) ttm->page_flags &= ~TTM_PAGE_FLAG_PRIV_POPULATED ; } +#ifdef CONFIG_DEBUG_FS + +/* Test the shrinker functions and dump the result */ +static int ttm_tt_debugfs_shrink_show (struct seq_file *m,void *data) +{ +struct ttm_operation_ctx ctx = { false, false }; + +seq_printf (m,"%d\n" ,ttm_global_swapout (&ctx,GFP_KERNEL )); +return 0 ; +} +DEFINE_SHOW_ATTRIBUTE (ttm_tt_debugfs_shrink); + +#endif + +/** * ttm_tt_mgr_init - register with the MM shrinker *
@@ -396,6 +411,11 @@ void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)*/ void ttm_tt_mgr_init (unsigned long num_pages,unsigned long num_dma32_pages) { +#ifdef CONFIG_DEBUG_FS +debugfs_create_file ("tt_shrink" ,0400 , ttm_debugfs_root,NULL , + &ttm_tt_debugfs_shrink_fops); +#endif +if (!ttm_pages_limit) ttm_pages_limit = num_pages;
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/2] drm/ttm: re-add debugs tt_shrink file
Quoted 4 lines · Christian König
That got lost when we moved back to a static limit.
Signed-off-by Christian König <[email protected]>
Reviewed-by Matthew Auld <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Christian König
The function returns the number of swapped pages here. Only abort when we get a negative error code.
Signed-off-by Christian König <[email protected]>
Reviewed-by Matthew Auld <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel