aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_pool.c
diff options
context:
space:
mode:
authorThomas Hellström <[email protected]>2025-05-02 13:00:14 +0000
committerThomas Hellström <[email protected]>2025-05-06 08:57:27 +0000
commitd4ad53adfe21df1464bae5ed916085a69d6ffb3d (patch)
treee2f78c229eeae89f65e23e8d89395c47fb21434d /drivers/gpu/drm/ttm/ttm_pool.c
parentdrm/ttm: Fix ttm_backup kerneldoc (diff)
downloadkernel-d4ad53adfe21df1464bae5ed916085a69d6ffb3d.tar.gz
kernel-d4ad53adfe21df1464bae5ed916085a69d6ffb3d.zip
drm/ttm: Remove the struct ttm_backup abstraction
The abstraction was previously added to support separate ttm_backup implementations. However with the current implementation casting from a struct file to a struct ttm_backup, we run into trouble since struct file may have randomized the layout and gcc complains. Remove the struct ttm_backup abstraction Cc: [email protected] Cc: Matthew Brost <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Christian König <[email protected]> Cc: Matthew Auld <[email protected]> Cc: Al Viro <[email protected]> Reported-by: Kees Cook <[email protected]> Closes: https://lore.kernel.org/dri-devel/[email protected]/T/#mb153ab9216cb813b92bdeb36f391ad4808c2ba29 Suggested-by: Christian König <[email protected]> Fixes: 70d645deac98 ("drm/ttm: Add helpers for shrinking") Signed-off-by: Thomas Hellström <[email protected]> Reviewed-by: Christian König <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_pool.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_pool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index 83b10706ba89..c2ea865be657 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -506,7 +506,7 @@ static void ttm_pool_allocated_page_commit(struct page *allocated,
* if successful, populate the page-table and dma-address arrays.
*/
static int ttm_pool_restore_commit(struct ttm_pool_tt_restore *restore,
- struct ttm_backup *backup,
+ struct file *backup,
const struct ttm_operation_ctx *ctx,
struct ttm_pool_alloc_state *alloc)
@@ -655,7 +655,7 @@ static void ttm_pool_free_range(struct ttm_pool *pool, struct ttm_tt *tt,
pgoff_t start_page, pgoff_t end_page)
{
struct page **pages = &tt->pages[start_page];
- struct ttm_backup *backup = tt->backup;
+ struct file *backup = tt->backup;
pgoff_t i, nr;
for (i = start_page; i < end_page; i += nr, pages += nr) {
@@ -963,7 +963,7 @@ void ttm_pool_drop_backed_up(struct ttm_tt *tt)
long ttm_pool_backup(struct ttm_pool *pool, struct ttm_tt *tt,
const struct ttm_backup_flags *flags)
{
- struct ttm_backup *backup = tt->backup;
+ struct file *backup = tt->backup;
struct page *page;
unsigned long handle;
gfp_t alloc_gfp;