Skip to content

Commit ef535bd

Browse files
yanghaku6by9
authored andcommitted
Add amdgpu support for arm SoC
Change-Id: Ic95c8514271d246dd668631810e8dee210f7f1b4 Signed-off-by: Yanghaku <[email protected]>
1 parent 95c057d commit ef535bd

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

drivers/gpu/drm/ttm/ttm_bo_util.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,6 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo,
348348
.no_wait_gpu = false
349349
};
350350
struct ttm_tt *ttm = bo->ttm;
351-
struct ttm_resource_manager *man =
352-
ttm_manager_type(bo->bdev, bo->resource->mem_type);
353351
pgprot_t prot;
354352
int ret;
355353

@@ -359,17 +357,7 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo,
359357
if (ret)
360358
return ret;
361359

362-
if (num_pages == 1 && ttm->caching == ttm_cached &&
363-
!(man->use_tt && (ttm->page_flags & TTM_TT_FLAG_DECRYPTED))) {
364-
/*
365-
* We're mapping a single page, and the desired
366-
* page protection is consistent with the bo.
367-
*/
368-
369-
map->bo_kmap_type = ttm_bo_map_kmap;
370-
map->page = ttm->pages[start_page];
371-
map->virtual = kmap(map->page);
372-
} else {
360+
{
373361
/*
374362
* We need to use vmap to get the desired page protection
375363
* or to make the buffer object look contiguous.

drivers/gpu/drm/ttm/ttm_module.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ pgprot_t ttm_prot_from_caching(enum ttm_caching caching, pgprot_t tmp)
6363
{
6464
/* Cached mappings need no adjustment */
6565
if (caching == ttm_cached)
66+
{
67+
#ifdef CONFIG_ARM64
68+
return pgprot_dmacoherent(tmp);
69+
#endif
6670
return tmp;
71+
}
6772

6873
#if defined(__i386__) || defined(__x86_64__)
6974
if (caching == ttm_write_combined)

0 commit comments

Comments
 (0)