Skip to content

Commit 0aea6ab

Browse files
apply dmacoherent patch for arm64
1 parent 795e4fe commit 0aea6ab

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

drivers/gpu/drm/ttm/ttm_bo_util.c

Lines changed: 7 additions & 3 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,6 +357,9 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo,
359357
if (ret)
360358
return ret;
361359

360+
#ifndef CONFIG_ARM64
361+
struct ttm_resource_manager *man =
362+
ttm_manager_type(bo->bdev, bo->resource->mem_type);
362363
if (num_pages == 1 && ttm->caching == ttm_cached &&
363364
!(man->use_tt && (ttm->page_flags & TTM_TT_FLAG_DECRYPTED))) {
364365
/*
@@ -369,7 +370,10 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo,
369370
map->bo_kmap_type = ttm_bo_map_kmap;
370371
map->page = ttm->pages[start_page];
371372
map->virtual = kmap(map->page);
372-
} else {
373+
}
374+
else
375+
#endif
376+
{
373377
/*
374378
* We need to use vmap to get the desired page protection
375379
* or to make the buffer object look contiguous.

drivers/gpu/drm/ttm/ttm_module.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@
6262
pgprot_t ttm_prot_from_caching(enum ttm_caching caching, pgprot_t tmp)
6363
{
6464
/* Cached mappings need no adjustment */
65-
if (caching == ttm_cached)
65+
if (caching == ttm_cached) {
66+
#ifdef CONFIG_ARM64
67+
return pgprot_dmacoherent(tmp);
68+
#endif
6669
return tmp;
70+
}
6771

6872
#if defined(__i386__) || defined(__x86_64__)
6973
if (caching == ttm_write_combined)

drivers/pci/setup-bus.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2389,6 +2389,26 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
23892389
}
23902390
EXPORT_SYMBOL_GPL(pci_assign_unassigned_bridge_resources);
23912391

2392+
static void pci_release_resource_type(struct pci_dev *pdev, unsigned long type)
2393+
{
2394+
int i;
2395+
2396+
if (!device_trylock(&pdev->dev))
2397+
return;
2398+
2399+
if (pdev->dev.driver)
2400+
goto unlock;
2401+
2402+
for (i = 0; i < PCI_STD_NUM_BARS; i++) {
2403+
if (pci_resource_len(pdev, i) &&
2404+
!((pci_resource_flags(pdev, i) ^ type) & PCI_RES_TYPE_MASK))
2405+
pci_release_resource(pdev, i);
2406+
}
2407+
2408+
unlock:
2409+
device_unlock(&pdev->dev);
2410+
}
2411+
23922412
int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long type)
23932413
{
23942414
struct pci_dev_resource *dev_res;
@@ -2423,8 +2443,10 @@ int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long type)
24232443

24242444
pci_info(bridge, "%s %pR: releasing\n", res_name, res);
24252445

2426-
if (res->parent)
2446+
if (res->parent) {
24272447
release_resource(res);
2448+
pci_release_resource_type(bridge, type);
2449+
}
24282450
res->start = 0;
24292451
res->end = 0;
24302452
break;

drivers/video/fbdev/core/fbmem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ static int do_register_framebuffer(struct fb_info *fb_info)
463463
if (err < 0)
464464
return err;
465465

466+
fb_info->node = i;
466467
refcount_set(&fb_info->count, 1);
467468
mutex_init(&fb_info->lock);
468469
mutex_init(&fb_info->mm_lock);

0 commit comments

Comments
 (0)