Displaying 20 results from an estimated 134 matches for "ttm_pl_vram".
2009 Aug 19
1
[PATCH] drm/nouveau: Add a MM for mappable VRAM that isn't usable as scanout.
...dev_priv->vm_vram_base;
+ break;
+ }
case TTM_PL_TT:
switch (dev_priv->gart_info.type) {
case NOUVEAU_GART_AGP:
@@ -564,6 +582,7 @@ nouveau_bo_verify_access(struct ttm_buffer_object *bo, struct file *filp)
static uint32_t nouveau_mem_prios[] = {
TTM_PL_PRIV0,
+ TTM_PL_PRIV1,
TTM_PL_VRAM,
TTM_PL_TT,
TTM_PL_SYSTEM
@@ -571,6 +590,7 @@ static uint32_t nouveau_mem_prios[] = {
static uint32_t nouveau_busy_prios[] = {
TTM_PL_TT,
TTM_PL_PRIV0,
+ TTM_PL_PRIV1,
TTM_PL_VRAM,
TTM_PL_SYSTEM
};
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_d...
2013 Sep 02
0
[PATCH] drm/nv50-: fix tiled memory layout checks
...T);
- u64 src_offset = node->vma[0].offset;
- u64 dst_offset = node->vma[1].offset;
+ u64 src_offset = old_node->vma[0].offset;
+ u64 dst_offset = old_node->vma[1].offset;
u32 size;
int ret;
size = 18;
- if (nouveau_bo_tile_layout(nvbo)) {
- size += 6 * (old_mem->mem_type == TTM_PL_VRAM);
- size += 6 * (new_mem->mem_type == TTM_PL_VRAM);
- }
+ size += 6 * (!!old_node->memtype + !!new_node->memtype);
size *= (length + (4 * 1024 * 1024) - 1) / (4 * 1024 * 1024);
ret = RING_SPACE(chan, size);
if (ret)
@@ -859,8 +859,7 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan,...
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...can't we just call that function?
Something like this:
drm_gem_vram_push_to_system()
{
if (gbo->pin_count == 1 && gbo->kmap.virtual)
ttm_bo_kunmap(&gbo->kmap);
return drm_gem_vram_unpin();
}
> +struct drm_gem_vram_object {
> + /* Supported placements are %TTM_PL_VRAM and %TTM_PL_SYSTEM */
> + struct ttm_placement placement;
> + struct ttm_place placements[3];
placements[2] should be enough I guess?
cheers,
Gerd
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...can't we just call that function?
Something like this:
drm_gem_vram_push_to_system()
{
if (gbo->pin_count == 1 && gbo->kmap.virtual)
ttm_bo_kunmap(&gbo->kmap);
return drm_gem_vram_unpin();
}
> +struct drm_gem_vram_object {
> + /* Supported placements are %TTM_PL_VRAM and %TTM_PL_SYSTEM */
> + struct ttm_placement placement;
> + struct ttm_place placements[3];
placements[2] should be enough I guess?
cheers,
Gerd
2013 Jul 15
3
[PATCH] drm/nouveau: do not move buffers when not needed
...->pdev, 1) >> PAGE_SHIFT;
- /* as long as the bo isn't in vram, and isn't tiled, we've got
- * nothing to do here.
+ /*
+ * if the bo is not in vram, or remapping can be done (nv50+)
+ * do not worry about placement, any location is valid
*/
- if (bo->mem.mem_type != TTM_PL_VRAM) {
- if (nv_device(drm->device)->card_type < NV_50 ||
- !nouveau_bo_tile_layout(nvbo))
- return 0;
- }
+ if (nv_device(drm->device)->card_type >= NV_50 ||
+ bo->mem.mem_type != TTM_PL_VRAM)
+ return 0;
/* make sure bo is in mappable vram */
if (bo->mem.sta...
2013 Mar 05
0
[PATCH] drm/nouveau/nv50: use correct tiling methods for m2mf buffer moves
...c
index 11ca821..7ff1071 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -801,7 +801,7 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
stride = 16 * 4;
height = amount / stride;
- if (new_mem->mem_type == TTM_PL_VRAM &&
+ if (old_mem->mem_type == TTM_PL_VRAM &&
nouveau_bo_tile_layout(nvbo)) {
ret = RING_SPACE(chan, 8);
if (ret)
@@ -823,7 +823,7 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
BEGIN_NV04(chan, NvSubCopy, 0x0200, 1);
OUT_R...
2019 May 06
1
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...placement in system memory.
Ah, missed that detail.
> We
> could build a common implementation out of both interfaces, but that
> would obfuscate the code IMHO. I'd just leave it as it is.
Ok.
> >> +struct drm_gem_vram_object {
> >> + /* Supported placements are %TTM_PL_VRAM and %TTM_PL_SYSTEM */
> >> + struct ttm_placement placement;
> >> + struct ttm_place placements[3];
> >
> > placements[2] should be enough I guess?
>
> TTM_PL_VRAM has index 2 and TTM_PL_SYSTEM has index 0. There's TTM_PL_TT
> at index 1. We don't us...
2019 Feb 15
1
[PATCH] drm/nouveau/bo: mark expected switch fall-through
...3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (drm->client.mem->oclass < NVIF_CLASS_MEM_NV50 || !mem->kind)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
> drivers/gpu/drm/nouveau/nouveau_bo.c:1438:2: note: here
> case TTM_PL_VRAM:
> ^~~~
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> Notice that, in this particular case, the code comment is modified
> in accordance with what GCC is expecting to find.
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough...
2013 Sep 04
1
[PATCH] drm/nouveau: do not move buffers when not needed
...;t tiled, we've got
>> - * nothing to do here.
>> + /*
>> + * if the bo is not in vram, or remapping can be done (nv50+)
>> + * do not worry about placement, any location is valid
>> */
>> - if (bo->mem.mem_type != TTM_PL_VRAM) {
>> - if (nv_device(drm->device)->card_type < NV_50 ||
>> - !nouveau_bo_tile_layout(nvbo))
>> - return 0;
>> - }
>> + if (nv_device(drm->device)->card_type >= NV_50 ||
>> +...
2013 Jul 12
2
[PATCH] drm/nouveau: kill nouveau_ttm_fault_reserve_notify handler to prevent useless buffer moves
...*nvbo = nouveau_bo(bo);
- struct nouveau_device *device = nv_device(drm->device);
- u32 mappable = pci_resource_len(device->pdev, 1) >> PAGE_SHIFT;
-
- /* as long as the bo isn't in vram, and isn't tiled, we've got
- * nothing to do here.
- */
- if (bo->mem.mem_type != TTM_PL_VRAM) {
- if (nv_device(drm->device)->card_type < NV_50 ||
- !nouveau_bo_tile_layout(nvbo))
- return 0;
- }
-
- /* make sure bo is in mappable vram */
- if (bo->mem.start + bo->mem.num_pages < mappable)
- return 0;
-
-
- nvbo->placement.fpfn = 0;
- nvbo->placement.lpfn =...
2012 Nov 21
2
[PATCH] drm/nouveau: fix takedown in move_notify
...) {
+ vma = list_first_entry(&nvbo->vma_list, struct nouveau_vma, head);
+
+ nouveau_vm_unmap(vma);
+ nouveau_vm_put(vma);
+ list_del(&vma->head);
+ }
+ return;
+ }
+
list_for_each_entry(vma, &nvbo->vma_list, head) {
- if (new_mem && new_mem->mem_type == TTM_PL_VRAM) {
+ if (new_mem->mem_type == TTM_PL_VRAM) {
nouveau_vm_map(vma, new_mem->mm_node);
- } else
- if (new_mem && new_mem->mem_type == TTM_PL_TT &&
- nvbo->page_shift == vma->vm->vmm->spg_shift) {
+ } else if (new_mem->mem_type == TTM_PL_TT &&...
2018 Dec 12
0
[PATCH v2 06/18] drm/qxl: use separate offset spaces for the two slots / ttm memory types.
...ivers/gpu/drm/qxl/qxl_drv.h
@@ -136,6 +136,7 @@ struct qxl_memslot {
uint64_t start_phys_addr;
uint64_t size;
uint64_t high_bits;
+ uint64_t gpu_offset;
};
enum {
@@ -312,8 +313,10 @@ qxl_bo_physical_address(struct qxl_device *qdev, struct qxl_bo *bo,
(bo->tbo.mem.mem_type == TTM_PL_VRAM)
? &qdev->main_slot : &qdev->surfaces_slot;
+ WARN_ON_ONCE((bo->tbo.offset & slot->gpu_offset) != slot->gpu_offset);
+
/* TODO - need to hold one of the locks to read tbo.offset */
- return slot->high_bits | (bo->tbo.offset + offset);
+ return slot->high_b...
2019 Jan 29
2
[PATCH] drm/nouveau: mark expected switch fall-through
...veau_bo.c
@@ -1434,7 +1434,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg)
if (drm->client.mem->oclass < NVIF_CLASS_MEM_NV50 || !mem->kind)
/* untiled */
break;
- /* fallthrough, tiled memory */
+ /* fall through - tiled memory */
case TTM_PL_VRAM:
reg->bus.offset = reg->start << PAGE_SHIFT;
reg->bus.base = device->func->resource_addr(device, 1);
--
2.20.1
2014 Dec 30
2
[PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
...dev, bool runtime)
> {
> struct nouveau_drm *drm = nouveau_drm(dev);
> @@ -559,8 +560,10 @@ nouveau_do_suspend(struct drm_device *dev, bool runtime)
> return ret;
> }
>
> - NV_INFO(drm, "evicting buffers...\n");
> - ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM);
> + if (dev->pdev) {
> + NV_INFO(drm, "evicting buffers...\n");
> + ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM);
> + }
>
> NV_INFO(drm, "waiting for kernel channels to go idle...\n");
> if (drm->cechan) {
> @@ -612,8 +615,9 @@ fail...
2019 Apr 09
0
[PATCH 13/15] drm/vboxvideo: Convert vboxvideo driver to Simple TTM
...ype,
> - struct ttm_mem_type_manager *man)
> -{
> - switch (type) {
> - case TTM_PL_SYSTEM:
> - man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
> - man->available_caching = TTM_PL_MASK_CACHING;
> - man->default_caching = TTM_PL_FLAG_CACHED;
> - break;
> - case TTM_PL_VRAM:
> - man->func = &ttm_bo_manager_func;
> - man->flags = TTM_MEMTYPE_FLAG_FIXED | TTM_MEMTYPE_FLAG_MAPPABLE;
> - man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
> - man->default_caching = TTM_PL_FLAG_WC;
> - break;
> - default:
> - DRM_ERROR...
2010 Mar 18
0
[PATCH] drm/nouveau: Make use of TTM busy_placements.
...NO_EVICT;
+ nouveau_bo_placement_set(nvbo, bo->mem.placement, 0);
ret = ttm_bo_validate(bo, &nvbo->placement, false, false);
if (ret == 0) {
@@ -439,10 +443,11 @@ nouveau_bo_evict_flags(struct ttm_buffer_object *bo, struct ttm_placement *pl)
switch (bo->mem.mem_type) {
case TTM_PL_VRAM:
- nouveau_bo_placement_set(nvbo, TTM_PL_FLAG_TT);
+ nouveau_bo_placement_set(nvbo, TTM_PL_FLAG_TT,
+ TTM_PL_FLAG_SYSTEM);
break;
default:
- nouveau_bo_placement_set(nvbo, TTM_PL_FLAG_SYSTEM);
+ nouveau_bo_placement_set(nvbo, TTM_PL_FLAG_SYSTEM, 0);
break;
}
diff --git a/driver...
2019 Apr 24
0
[PATCH v2 07/17] drm/ast: Convert AST driver to VRAM MM
...em_type(struct ttm_bo_device *bdev, uint32_t type,
- struct ttm_mem_type_manager *man)
-{
- switch (type) {
- case TTM_PL_SYSTEM:
- man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
- man->available_caching = TTM_PL_MASK_CACHING;
- man->default_caching = TTM_PL_FLAG_CACHED;
- break;
- case TTM_PL_VRAM:
- man->func = &ttm_bo_manager_func;
- man->flags = TTM_MEMTYPE_FLAG_FIXED |
- TTM_MEMTYPE_FLAG_MAPPABLE;
- man->available_caching = TTM_PL_FLAG_UNCACHED |
- TTM_PL_FLAG_WC;
- man->default_caching = TTM_PL_FLAG_WC;
- break;
- default:
- DRM_ERROR("Unsupported memory t...
2019 May 06
0
[PATCH v4 12/19] drm/bochs: Convert bochs driver to VRAM MM
...mem_type(struct ttm_bo_device *bdev, uint32_t type,
- struct ttm_mem_type_manager *man)
-{
- switch (type) {
- case TTM_PL_SYSTEM:
- man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
- man->available_caching = TTM_PL_MASK_CACHING;
- man->default_caching = TTM_PL_FLAG_CACHED;
- break;
- case TTM_PL_VRAM:
- man->func = &ttm_bo_manager_func;
- man->flags = TTM_MEMTYPE_FLAG_FIXED |
- TTM_MEMTYPE_FLAG_MAPPABLE;
- man->available_caching = TTM_PL_FLAG_UNCACHED |
- TTM_PL_FLAG_WC;
- man->default_caching = TTM_PL_FLAG_WC;
- break;
- default:
- DRM_ERROR("Unsupported memory t...
2019 May 06
0
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...st leave it as it is.
The function is only used by ast and mgag200 framebuffer handling. It's
actually something that should be done by VRAM MM, but both drivers are
non-atomic and could require an overhaul anyway.
>> +struct drm_gem_vram_object {
>> + /* Supported placements are %TTM_PL_VRAM and %TTM_PL_SYSTEM */
>> + struct ttm_placement placement;
>> + struct ttm_place placements[3];
>
> placements[2] should be enough I guess?
TTM_PL_VRAM has index 2 and TTM_PL_SYSTEM has index 0. There's TTM_PL_TT
at index 1. We don't use all three array entries here, but...
2010 Jan 16
0
[PATCH] drm/nouveau: Evict buffers in VRAM before freeing sgdma
...644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -386,7 +386,6 @@ void nouveau_mem_close(struct drm_device *dev)
nouveau_bo_unpin(dev_priv->vga_ram);
nouveau_bo_ref(NULL, &dev_priv->vga_ram);
- ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM);
ttm_bo_device_release(&dev_priv->ttm.bdev);
nouveau_ttm_global_release(dev_priv);
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index 09b9a46..c212742 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/n...