Displaying 20 results from an estimated 84 matches for "ttm_bo_kunmap".
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...rm_gem_vram_object *gbo)
> +{
> + int i, ret;
> + struct ttm_operation_ctx ctx = { false, false };
> +
> + if (!gbo->pin_count)
> + return 0;
Likewise.
> + --gbo->pin_count;
> + 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);
&g...
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...rm_gem_vram_object *gbo)
> +{
> + int i, ret;
> + struct ttm_operation_ctx ctx = { false, false };
> +
> + if (!gbo->pin_count)
> + return 0;
Likewise.
> + --gbo->pin_count;
> + 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);
&g...
2020 Oct 15
5
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...ttm_bo_driver.h>
> #include <drm/ttm/ttm_placement.h>
> #include <drm/drm_vma_manager.h>
> +#include <linux/dma-buf-map.h>
> #include <linux/io.h>
> #include <linux/highmem.h>
> #include <linux/wait.h>
> @@ -526,6 +527,77 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
> }
> EXPORT_SYMBOL(ttm_bo_kunmap);
>
> +int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
> +{
> + struct ttm_resource *mem = &bo->mem;
> + int ret;
> +
> + ret = ttm_mem_io_reserve(bo->bdev, mem);
> +...
2020 Oct 15
1
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...t.h>
> > > #include <drm/drm_vma_manager.h>
> > > +#include <linux/dma-buf-map.h>
> > > #include <linux/io.h>
> > > #include <linux/highmem.h>
> > > #include <linux/wait.h>
> > > @@ -526,6 +527,77 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
> > > }
> > > EXPORT_SYMBOL(ttm_bo_kunmap);
> > > +int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
> > > +{
> > > + struct ttm_resource *mem = &bo->mem;
> > > + int ret;
> > &g...
2019 Apr 29
0
[PATCH v3 15/19] drm/mgag200: Replace mapping code with drm_gem_vram_{kmap/kunmap}()
...drm_crtc *crtc,
}
}
}
- memcpy_toio(pixels_prev->kmap.virtual + row*48, &this_row[0], 48);
+ memcpy_toio(dst + row*48, &this_row[0], 48);
}
/* Program gpu address of cursor buffer */
@@ -247,9 +244,9 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
}
ret = 0;
- ttm_bo_kunmap(&pixels_prev->kmap);
+ drm_gem_vram_kunmap(pixels_prev);
out3:
- ttm_bo_kunmap(&gbo->kmap);
+ drm_gem_vram_kunmap(gbo);
out2:
drm_gem_vram_unreserve(gbo);
out1:
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h
index 16ce6b338dce..6180a...
2019 May 06
0
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
Hi
thanks for reviewing the patches.
Am 06.05.19 um 14:31 schrieb Gerd Hoffmann:
>> + --gbo->pin_count;
>> + 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->...
2020 Oct 15
0
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...@@ -32,6 +32,7 @@
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/drm_vma_manager.h>
+#include <linux/dma-buf-map.h>
#include <linux/io.h>
#include <linux/highmem.h>
#include <linux/wait.h>
@@ -526,6 +527,77 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
}
EXPORT_SYMBOL(ttm_bo_kunmap);
+int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
+{
+ struct ttm_resource *mem = &bo->mem;
+ int ret;
+
+ ret = ttm_mem_io_reserve(bo->bdev, mem);
+ if (ret)
+ return ret;
+
+ if (mem->bus.is_iomem...
2010 Feb 19
2
[PATCH 1/2] drm/nouveau: Unmap pushbuf BOs when we're done with them.
...gpu/drm/nouveau/nouveau_gem.c
index fb6d87b..ec6da5c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -243,6 +243,8 @@ validate_fini_list(struct list_head *list, struct nouveau_fence *fence)
nouveau_fence_unref((void *)&prev_fence);
}
+ ttm_bo_kunmap(&nvbo->kmap);
+
list_del(&nvbo->entry);
nvbo->reserved_by = NULL;
ttm_bo_unreserve(&nvbo->bo);
--
1.6.4.4
2020 Oct 20
0
[PATCH v5 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...@@ -32,6 +32,7 @@
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/drm_vma_manager.h>
+#include <linux/dma-buf-map.h>
#include <linux/io.h>
#include <linux/highmem.h>
#include <linux/wait.h>
@@ -527,6 +528,77 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
}
EXPORT_SYMBOL(ttm_bo_kunmap);
+int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
+{
+ struct ttm_resource *mem = &bo->mem;
+ int ret;
+
+ ret = ttm_mem_io_reserve(bo->bdev, mem);
+ if (ret)
+ return ret;
+
+ if (mem->bus.is_iomem...
2009 Aug 04
5
[PATCH 1/6] drm/nouveau: bo read/write wrappers for nv04_crtc.c
...nsertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index d59ffc4..442bab7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -172,6 +172,29 @@ nouveau_bo_unmap(struct nouveau_bo *nvbo)
ttm_bo_kunmap(&nvbo->kmap);
}
+u32
+nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index)
+{
+ bool is_iomem;
+ u32 *mem = ttm_kmap_obj_virtual(&nvbo->kmap, &is_iomem);
+ mem = &mem[index];
+ if (is_iomem)
+ return ioread32_native((void __force __iomem *)mem);
+ else
+ return *mem;...
2020 Oct 15
0
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...clude <drm/ttm/ttm_placement.h>
> > #include <drm/drm_vma_manager.h>
> > +#include <linux/dma-buf-map.h>
> > #include <linux/io.h>
> > #include <linux/highmem.h>
> > #include <linux/wait.h>
> > @@ -526,6 +527,77 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
> > }
> > EXPORT_SYMBOL(ttm_bo_kunmap);
> > +int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
> > +{
> > + struct ttm_resource *mem = &bo->mem;
> > + int ret;
> > +
> > + ret = ttm_mem_io_r...
2020 Oct 19
1
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...? #include <drm/ttm/ttm_placement.h>
>> ? #include <drm/drm_vma_manager.h>
>> +#include <linux/dma-buf-map.h>
>> ? #include <linux/io.h>
>> ? #include <linux/highmem.h>
>> ? #include <linux/wait.h>
>> @@ -526,6 +527,77 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map)
>> ? }
>> ? EXPORT_SYMBOL(ttm_bo_kunmap);
>> ? +int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
>> +{
>> +??? struct ttm_resource *mem = &bo->mem;
>> +??? int ret;
>> +
>> +??? ret = ttm_mem_i...
2014 Jul 10
2
[PATCH v4 4/6] drm/nouveau: synchronize BOs when required
...-git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 67e9e8e2e2ec..47e4e8886769 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -402,6 +402,60 @@ nouveau_bo_unmap(struct nouveau_bo *nvbo)
> ttm_bo_kunmap(&nvbo->kmap);
> }
>
> +void
> +nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)
> +{
> + struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
> + struct nouveau_device *device = nouveau_dev(drm->dev);
> + struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *...
2009 Aug 02
3
[PATCH 1/4] drm/nouveau: refactor VGA font save/restore
Remove drm_nouveau_private::fb member and map the piece of VRAM only
when accessing VGA fonts.
Collect copied code into the static function nouveau_vga_font_io().
Signed-off-by: Pekka Paalanen <pq at iki.fi>
---
drivers/gpu/drm/nouveau/nouveau_drv.h | 17 -------
drivers/gpu/drm/nouveau/nouveau_hw.c | 75 +++++++++++++++----------------
drivers/gpu/drm/nouveau/nouveau_state.c |
2009 Aug 17
8
drm bo accessors etc. v2
Revised patch set v2.
[PATCH 1/8] drm/nouveau: bo read/write wrappers for nv04_crtc.c
[PATCH 2/8] drm/nouveau: use bo accessors for push buffers
[PATCH 3/8] drm/nouveau: OUT_RINGp - optimize OUT_RING loops
[PATCH 4/8] drm/nv50: proper notifier_bo access in nv50_display_vblank_crtc_handler()
[PATCH 5/8] drm/nouveau: access fbcon notifier via bo accessors
[PATCH 6/8] drm/nouveau: screen_base and
2016 Jul 13
1
[PATCH 1/2] ttm: remove special handling of coherent objects
...ttm_bo_unreserve(&nvbo->bo);
return ret;
@@ -442,12 +436,7 @@ nouveau_bo_unmap(struct nouveau_bo *nvbo)
if (!nvbo)
return;
- /*
- * TTM buffers allocated using the DMA API already had a coherent
- * mapping which we used, no need to unmap.
- */
- if (!nvbo->force_coherent)
- ttm_bo_kunmap(&nvbo->kmap);
+ ttm_bo_kunmap(&nvbo->kmap);
}
void
@@ -506,35 +495,13 @@ nouveau_bo_validate(struct nouveau_bo *nvbo, bool interruptible,
return 0;
}
-static inline void *
-_nouveau_bo_mem_index(struct nouveau_bo *nvbo, unsigned index, void *mem, u8 sz)
-{
- struct ttm_dma_tt...
2014 Jul 11
1
[PATCH v4 4/6] drm/nouveau: synchronize BOs when required
....c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> >>index 67e9e8e2e2ec..47e4e8886769 100644
> >>--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> >>+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> >>@@ -402,6 +402,60 @@ nouveau_bo_unmap(struct nouveau_bo *nvbo)
> >> ttm_bo_kunmap(&nvbo->kmap);
> >> }
> >>
> >>+void
> >>+nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)
> >>+{
> >>+ struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
> >>+ struct nouveau_device *device = nouveau_dev(drm->dev);...
2019 Apr 29
21
[PATCH v3 00/19] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each
other. The implementation is always the same; except for the name of
some data structures.
As recently discussed, this patch set provides generic memory-management
code for simple framebuffers with dedicated video memory. It further
converts the respective drivers to the generic code. The shared code
is basically the same
2019 May 06
25
[PATCH v4 00/19] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each
other. The implementation is always the same; except for the name of
some data structures.
As recently discussed, this patch set provides generic memory-management
code for simple framebuffers with dedicated video memory. It further
converts the respective drivers to the generic code. The shared code
is basically the same
2019 May 06
25
[PATCH v4 00/19] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each
other. The implementation is always the same; except for the name of
some data structures.
As recently discussed, this patch set provides generic memory-management
code for simple framebuffers with dedicated video memory. It further
converts the respective drivers to the generic code. The shared code
is basically the same