Displaying 20 results from an estimated 52 matches for "ttm_pl_flag_no_evict".
2010 Mar 18
0
[PATCH] drm/nouveau: Make use of TTM busy_placements.
...EM | TTM_PL_MASK_CACHING;
- nvbo->placement.placement = nvbo->placements;
- nvbo->placement.busy_placement = nvbo->placements;
- nvbo->placement.num_placement = n;
- nvbo->placement.num_busy_placement = n;
-
- if (nvbo->pin_refcnt) {
- while (n--)
- nvbo->placements[n] |= TTM_PL_FLAG_NO_EVICT;
- }
+ struct ttm_placement *pl = &nvbo->placement;
+ uint32_t flags = TTM_PL_MASK_CACHING |
+ (nvbo->pin_refcnt ? TTM_PL_FLAG_NO_EVICT : 0);
+
+ pl->placement = nvbo->placements;
+ set_placement_list(nvbo->placements, &pl->num_placement,
+ type, flags);
+
+ pl->b...
2019 Mar 18
1
[PATCH v3 2/5] drm/virtio: use struct to pass params to virtio_gpu_object_create()
...e plan is to use the struct
for all object parameters.
Drop unused "kernel" parameter for virtio_gpu_alloc_object(), it is
unused and always false.
Also drop "pinned" parameter. virtio-gpu doesn't shuffle around
objects, so effecively they all are pinned anyway. Hardcode
TTM_PL_FLAG_NO_EVICT so ttm knows. Doesn't change much for the moment
as virtio-gpu supports TTM_PL_FLAG_TT only so there is no opportunity to
move around objects. That'll probably change in the future though.
Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
drivers/gpu/drm/virtio/virtgpu_drv.h...
2019 Oct 17
0
[PATCH 5/5] drm/qxl: allocate small objects top-down
...7b834..ad336c98a0cf 100644
--- a/drivers/gpu/drm/qxl/qxl_object.c
+++ b/drivers/gpu/drm/qxl/qxl_object.c
@@ -54,9 +54,14 @@ bool qxl_ttm_bo_is_qxl_bo(struct ttm_buffer_object *bo)
void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain, bool pinned)
{
u32 c = 0;
- u32 pflag = pinned ? TTM_PL_FLAG_NO_EVICT : 0;
+ u32 pflag = 0;
unsigned int i;
+ if (pinned)
+ pflag |= TTM_PL_FLAG_NO_EVICT;
+ if (qbo->tbo.base.size <= PAGE_SIZE)
+ pflag |= TTM_PL_FLAG_TOPDOWN;
+
qbo->placement.placement = qbo->placements;
qbo->placement.busy_placement = qbo->placements;
if (domain == QXL_...
2019 May 20
1
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...>>> + ++gbo->pin_count;
>>> + return 0;
>>> + }
>>> +
>>> + drm_gem_vram_placement(gbo, pl_flag);
>>> + for (i = 0; i < gbo->placement.num_placement; ++i)
>>> + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
>>> +
>>> + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
>>> + if (ret < 0)
>>> + return ret;
>>> +
>>> + gbo->pin_count = 1;
>>> +
>>> + return 0;
>>> +}
>>&...
2019 May 20
5
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...ith what we now have in dma-buf.
Cheers, Daniel
> +
> + if (gbo->pin_count) {
> + ++gbo->pin_count;
> + return 0;
> + }
> +
> + drm_gem_vram_placement(gbo, pl_flag);
> + for (i = 0; i < gbo->placement.num_placement; ++i)
> + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
> +
> + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
> + if (ret < 0)
> + return ret;
> +
> + gbo->pin_count = 1;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drm_gem_vram_pin_reserved);
> +
> /**
> * drm_gem_vram_unpin() - U...
2019 May 20
5
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...ith what we now have in dma-buf.
Cheers, Daniel
> +
> + if (gbo->pin_count) {
> + ++gbo->pin_count;
> + return 0;
> + }
> +
> + drm_gem_vram_placement(gbo, pl_flag);
> + for (i = 0; i < gbo->placement.num_placement; ++i)
> + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
> +
> + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
> + if (ret < 0)
> + return ret;
> +
> + gbo->pin_count = 1;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drm_gem_vram_pin_reserved);
> +
> /**
> * drm_gem_vram_unpin() - U...
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...t;
> + if (gbo->pin_count)
> + return 0;
> +
> + if (gbo->kmap.virtual)
> + ttm_bo_kunmap(&gbo->kmap);
> +
> + drm_gem_vram_placement(gbo, TTM_PL_FLAG_SYSTEM);
> + for (i = 0; i < gbo->placement.num_placement ; ++i)
> + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
> +
> + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
> + if (ret)
> + return ret;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drm_gem_vram_push_to_system);
Very simliar to drm_gem_vram_unpin, can't we just call that function?
Something like t...
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...t;
> + if (gbo->pin_count)
> + return 0;
> +
> + if (gbo->kmap.virtual)
> + ttm_bo_kunmap(&gbo->kmap);
> +
> + drm_gem_vram_placement(gbo, TTM_PL_FLAG_SYSTEM);
> + for (i = 0; i < gbo->placement.num_placement ; ++i)
> + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
> +
> + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
> + if (ret)
> + return ret;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drm_gem_vram_push_to_system);
Very simliar to drm_gem_vram_unpin, can't we just call that function?
Something like t...
2019 May 16
0
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...unsigned long pl_flag)
+{
+ int i, ret;
+ struct ttm_operation_ctx ctx = { false, false };
+
+ if (gbo->pin_count) {
+ ++gbo->pin_count;
+ return 0;
+ }
+
+ drm_gem_vram_placement(gbo, pl_flag);
+ for (i = 0; i < gbo->placement.num_placement; ++i)
+ gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
+
+ ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
+ if (ret < 0)
+ return ret;
+
+ gbo->pin_count = 1;
+
+ return 0;
+}
+EXPORT_SYMBOL(drm_gem_vram_pin_reserved);
+
/**
* drm_gem_vram_unpin() - Unpins a GEM VRAM object
* @gbo: the GEM VRAM object
@@ -285,6 +...
2019 May 16
5
[PATCH 0/2] Add BO reservation to GEM VRAM pin/unpin/push_to_system
A kernel test bot reported a problem with the locktorture testcase that
was triggered by the GEM VRAM helpers.
...
[ 10.004734] RIP: 0010:ttm_bo_validate+0x41/0x141 [ttm]
...
[ 10.015669] ? kvm_sched_clock_read+0x5/0xd
[ 10.016157] ? get_lock_stats+0x11/0x3f
[ 10.016607] drm_gem_vram_pin+0x77/0xa2 [drm_vram_helper]
[ 10.017229]
2019 May 16
5
[PATCH 0/2] Add BO reservation to GEM VRAM pin/unpin/push_to_system
A kernel test bot reported a problem with the locktorture testcase that
was triggered by the GEM VRAM helpers.
...
[ 10.004734] RIP: 0010:ttm_bo_validate+0x41/0x141 [ttm]
...
[ 10.015669] ? kvm_sched_clock_read+0x5/0xd
[ 10.016157] ? get_lock_stats+0x11/0x3f
[ 10.016607] drm_gem_vram_pin+0x77/0xa2 [drm_vram_helper]
[ 10.017229]
2019 May 20
0
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...gt;
> > +
> > + if (gbo->pin_count) {
> > + ++gbo->pin_count;
> > + return 0;
> > + }
> > +
> > + drm_gem_vram_placement(gbo, pl_flag);
> > + for (i = 0; i < gbo->placement.num_placement; ++i)
> > + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
> > +
> > + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
> > + if (ret < 0)
> > + return ret;
> > +
> > + gbo->pin_count = 1;
> > +
> > + return 0;
> > +}
> > +EXPORT_SYMBOL(drm_gem_vram_pin_reserved);...
2013 Aug 28
1
[PATCH 4/6] drm/nouveau: introduce NOUVEAU_GEM_TILE_WCUS
...eau_bo_placement_set(struct nouveau_bo *nvbo, uint32_t type, uint32_t busy)
> {
> struct ttm_placement *pl = &nvbo->placement;
> - uint32_t flags = TTM_PL_MASK_CACHING |
> + uint32_t flags = nvbo->valid_caching |
> (nvbo->pin_refcnt ? TTM_PL_FLAG_NO_EVICT : 0);
>
> pl->placement = nvbo->placements;
> @@ -1554,6 +1560,9 @@ nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
> if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
> nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
> els...
2019 Apr 29
4
[PATCH v3 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...struct ttm_operation_ctx ctx = { false, false };
> +
> + if (gbo->pin_count) {
> + ++gbo->pin_count;
> + return 0;
> + }
> +
> + drm_gem_vram_placement(gbo, pl_flag);
> + for (i = 0; i < gbo->placement.num_placement; ++i)
> + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
> +
> + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
> + if (ret < 0)
> + return ret;
> +
> + gbo->pin_count = 1;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drm_gem_vram_pin);
> +
> +/**
> + * drm_gem_vram_unpin() - Unpins a G...
2019 Apr 29
4
[PATCH v3 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...struct ttm_operation_ctx ctx = { false, false };
> +
> + if (gbo->pin_count) {
> + ++gbo->pin_count;
> + return 0;
> + }
> +
> + drm_gem_vram_placement(gbo, pl_flag);
> + for (i = 0; i < gbo->placement.num_placement; ++i)
> + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
> +
> + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
> + if (ret < 0)
> + return ret;
> +
> + gbo->pin_count = 1;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drm_gem_vram_pin);
> +
> +/**
> + * drm_gem_vram_unpin() - Unpins a G...
2019 May 06
0
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...bo, unsigned long pl_flag)
+{
+ int i, ret;
+ struct ttm_operation_ctx ctx = { false, false };
+
+ if (gbo->pin_count) {
+ ++gbo->pin_count;
+ return 0;
+ }
+
+ drm_gem_vram_placement(gbo, pl_flag);
+ for (i = 0; i < gbo->placement.num_placement; ++i)
+ gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
+
+ ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
+ if (ret < 0)
+ return ret;
+
+ gbo->pin_count = 1;
+
+ return 0;
+}
+EXPORT_SYMBOL(drm_gem_vram_pin);
+
+/**
+ * drm_gem_vram_unpin() - Unpins a GEM VRAM object
+ * @gbo: the GEM VRAM object
+ *
+ * Returns:
+ *...
2019 Apr 29
0
[PATCH v3 01/19] drm: Add |struct drm_gem_vram_object| and helpers
..._object *gbo, u32 pl_flag)
+{
+ int i, ret;
+ struct ttm_operation_ctx ctx = { false, false };
+
+ if (gbo->pin_count) {
+ ++gbo->pin_count;
+ return 0;
+ }
+
+ drm_gem_vram_placement(gbo, pl_flag);
+ for (i = 0; i < gbo->placement.num_placement; ++i)
+ gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
+
+ ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
+ if (ret < 0)
+ return ret;
+
+ gbo->pin_count = 1;
+
+ return 0;
+}
+EXPORT_SYMBOL(drm_gem_vram_pin);
+
+/**
+ * drm_gem_vram_unpin() - Unpins a GEM VRAM object
+ * @gbo: the GEM VRAM object
+ *
+ * Returns:
+ *...
2019 Apr 09
0
[PATCH 12/15] drm/vboxvideo: Convert vboxvideo driver to |struct drm_gem_ttm_object|
...nt) {
> - bo->pin_count++;
> - return 0;
> - }
> -
> - ret = vbox_bo_reserve(bo, false);
> - if (ret)
> - return ret;
> -
> - vbox_ttm_placement(bo, pl_flag);
> -
> - for (i = 0; i < bo->placement.num_placement; i++)
> - bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
> -
> - ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
> - if (ret == 0)
> - bo->pin_count = 1;
> -
> - vbox_bo_unreserve(bo);
> -
> - return ret;
> -}
> -
> -int vbox_bo_unpin(struct vbox_bo *bo)
> -{
> - struct ttm_operation_ctx...
2019 May 06
0
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...>> + return 0;
>> +
>> + if (gbo->kmap.virtual)
>> + ttm_bo_kunmap(&gbo->kmap);
>> +
>> + drm_gem_vram_placement(gbo, TTM_PL_FLAG_SYSTEM);
>> + for (i = 0; i < gbo->placement.num_placement ; ++i)
>> + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
>> +
>> + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx);
>> + if (ret)
>> + return ret;
>> +
>> + return 0;
>> +}
>> +EXPORT_SYMBOL(drm_gem_vram_push_to_system);
>
> Very simliar to drm_gem_vram_unpin, can't we...
2013 Aug 28
0
[PATCH 4/6] drm/nouveau: introduce NOUVEAU_GEM_TILE_WCUS
...p;drm->ttm.bdev, size,
@@ -292,7 +298,7 @@ void
nouveau_bo_placement_set(struct nouveau_bo *nvbo, uint32_t type, uint32_t busy)
{
struct ttm_placement *pl = &nvbo->placement;
- uint32_t flags = TTM_PL_MASK_CACHING |
+ uint32_t flags = nvbo->valid_caching |
(nvbo->pin_refcnt ? TTM_PL_FLAG_NO_EVICT : 0);
pl->placement = nvbo->placements;
@@ -1554,6 +1560,9 @@ nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
else if (nvbo->bo.mem.mem_type == TTM_PL_TT) {
+ if (!(nvb...