Displaying 20 results from an estimated 31 matches for "ttm_io_prot".
2014 Mar 26
2
[PATCH 00/12] drm/nouveau: support for GK20A, cont'd
...NCACHED. It is not clear to me why this is needed. The BO
being accessed through the BAR, they are correctly considered as IO
memory and mapped using ttm_bo_ioremap(), so it really seems to be
unhappy with the WC mapping itself.
Note that if I go ahead and force the use of pgprot_writecombine() in
ttm_io_prot() to get writecombined user-space mappings, pure DRM
programs that map a buffer and try to read it fail similarly, while
Mesa's glReadPixels() seems to be happy. I'm not sure what it does
differently here.
Cheers,
Alex.
2014 Jun 27
0
[PATCH] drm/ttm: recognize ARM arch in ioprot handler
...tm_bo_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 1df856f78568..30e5d90cb7bc 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -500,7 +500,7 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp)
pgprot_val(tmp) |= _PAGE_GUARDED;
}
#endif
-#if defined(__ia64__)
+#if defined(__ia64__) || defined(__arm__)
if (caching_flags & TTM_PL_FLAG_WC)
tmp = pgprot_writecombine(tmp);
else
--
2.0.0
2020 Oct 15
5
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...l just crash badly anyway.
> +
> + ret = ttm_tt_populate(bo->bdev, ttm, &ctx);
> + if (ret)
> + return ret;
> +
> + /*
> + * We need to use vmap to get the desired page protection
> + * or to make the buffer object look contiguous.
> + */
> + prot = ttm_io_prot(mem->placement, PAGE_KERNEL);
The calling convention has changed on drm-misc-next as well, but should
be trivial to adapt.
Regards,
Christian.
> + vaddr = vmap(ttm->pages, bo->num_pages, 0, prot);
> + if (!vaddr)
> + return -ENOMEM;
> +
> + dma_buf_map_set_vaddr(map...
2018 Oct 16
0
[PATCH 2/2] drm/ttm: Provide ttm_bo_global_{init/release}() for struct ttm_bo_global
...tm_bo_global_ref_init(struct drm_global_reference *ref);
+void ttm_bo_global_release(struct ttm_bo_global *glob);
+int ttm_bo_global_init(struct ttm_bo_global *glob,
+ struct ttm_mem_global *mem_glob);
int ttm_bo_device_release(struct ttm_bo_device *bdev);
@@ -897,4 +889,43 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp);
extern const struct ttm_mem_type_manager_func ttm_bo_manager_func;
+/**
+ * struct ttm_bo_global_ref - Argument to initialize a struct ttm_bo_global.
+ */
+
+struct ttm_bo_global_ref {
+ struct drm_global_reference ref;
+ struct ttm_mem_global *mem_glob;...
2014 Mar 26
0
[PATCH 00/12] drm/nouveau: support for GK20A, cont'd
...why this is needed. The BO
> being accessed through the BAR, they are correctly considered as IO
> memory and mapped using ttm_bo_ioremap(), so it really seems to be
> unhappy with the WC mapping itself.
>
> Note that if I go ahead and force the use of pgprot_writecombine() in
> ttm_io_prot() to get writecombined user-space mappings, pure DRM
> programs that map a buffer and try to read it fail similarly, while
> Mesa's glReadPixels() seems to be happy. I'm not sure what it does
> differently here.
>
> Cheers,
> Alex.
--
Pengutronix e.K....
2020 Oct 19
1
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...ttm, &ctx);
>> +??????? if (ret)
>> +??????????? return ret;
>> +
>> +??????? /*
>> +???????? * We need to use vmap to get the desired page protection
>> +???????? * or to make the buffer object look contiguous.
>> +???????? */
>> +??????? prot = ttm_io_prot(mem->placement, PAGE_KERNEL);
>
> The calling convention has changed on drm-misc-next as well, but should
> be trivial to adapt.
>
> Regards,
> Christian.
>
>> +??????? vaddr = vmap(ttm->pages, bo->num_pages, 0, prot);
>> +??????? if (!vaddr)
>> +?...
2020 Oct 15
1
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...gt; > > + if (ret)
> > > + return ret;
> > > +
> > > + /*
> > > + * We need to use vmap to get the desired page
> > > protection
> > > + * or to make the buffer object look contiguous.
> > > + */
> > > + prot = ttm_io_prot(mem->placement, PAGE_KERNEL);
> >
> > The calling convention has changed on drm-misc-next as well, but should be
> > trivial to adapt.
> >
> > Regards,
> > Christian.
> >
> > > + vaddr = vmap(ttm->pages, bo->num_pages, 0, prot);
> &...
2020 Oct 19
0
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...?????? if (ret)
>>> +??????????? return ret;
>>> +
>>> +??????? /*
>>> +???????? * We need to use vmap to get the desired page protection
>>> +???????? * or to make the buffer object look contiguous.
>>> +???????? */
>>> +??????? prot = ttm_io_prot(mem->placement, PAGE_KERNEL);
>> The calling convention has changed on drm-misc-next as well, but should
>> be trivial to adapt.
>>
>> Regards,
>> Christian.
>>
>>> +??????? vaddr = vmap(ttm->pages, bo->num_pages, 0, prot);
>>> +???????...
2020 Oct 15
0
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...tm_tt *ttm = bo->ttm;
+ pgprot_t prot;
+ void *vaddr;
+
+ BUG_ON(!ttm);
+
+ ret = ttm_tt_populate(bo->bdev, ttm, &ctx);
+ if (ret)
+ return ret;
+
+ /*
+ * We need to use vmap to get the desired page protection
+ * or to make the buffer object look contiguous.
+ */
+ prot = ttm_io_prot(mem->placement, PAGE_KERNEL);
+ vaddr = vmap(ttm->pages, bo->num_pages, 0, prot);
+ if (!vaddr)
+ return -ENOMEM;
+
+ dma_buf_map_set_vaddr(map, vaddr);
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(ttm_bo_vmap);
+
+void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
+{
+...
2020 Oct 20
0
[PATCH v5 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...e
+ };
+ struct ttm_tt *ttm = bo->ttm;
+ pgprot_t prot;
+ void *vaddr;
+
+ ret = ttm_tt_populate(bo->bdev, ttm, &ctx);
+ if (ret)
+ return ret;
+
+ /*
+ * We need to use vmap to get the desired page protection
+ * or to make the buffer object look contiguous.
+ */
+ prot = ttm_io_prot(bo, mem, PAGE_KERNEL);
+ vaddr = vmap(ttm->pages, bo->num_pages, 0, prot);
+ if (!vaddr)
+ return -ENOMEM;
+
+ dma_buf_map_set_vaddr(map, vaddr);
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(ttm_bo_vmap);
+
+void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
+{
+ struct ttm...
2020 Oct 15
0
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...+ ret = ttm_tt_populate(bo->bdev, ttm, &ctx);
> > + if (ret)
> > + return ret;
> > +
> > + /*
> > + * We need to use vmap to get the desired page protection
> > + * or to make the buffer object look contiguous.
> > + */
> > + prot = ttm_io_prot(mem->placement, PAGE_KERNEL);
>
> The calling convention has changed on drm-misc-next as well, but should be
> trivial to adapt.
>
> Regards,
> Christian.
>
> > + vaddr = vmap(ttm->pages, bo->num_pages, 0, prot);
> > + if (!vaddr)
> > + return...
2014 Jun 24
4
[PATCH v2 0/3] drm/ttm: nouveau: memory coherency for ARM
For this v2 I have fixed the patches that are non-controversial (all Lucas' :))
and am resubmitting them in the hope that they will get merged. This will
just leave the issue of Nouveau system-memory buffers mapping to be solved.
This issue is quite complex, so let me summarize the situation and the data
I have at hand. ARM caching is like a quantum world where Murphy's law
constantly
2020 Sep 01
0
[PATCH 3/3] drm/ttm: remove io_reserve_lru handling v2
...page_last = vma_pages(vma) + vma->vm_pgoff -
drm_vma_node_start(&bo->base.vma_node);
- if (unlikely(page_offset >= bo->num_pages)) {
- ret = VM_FAULT_SIGBUS;
- goto out_io_unlock;
- }
+ if (unlikely(page_offset >= bo->num_pages))
+ return VM_FAULT_SIGBUS;
prot = ttm_io_prot(bo->mem.placement, prot);
if (!bo->mem.bus.is_iomem) {
@@ -350,21 +341,17 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
};
ttm = bo->ttm;
- if (ttm_tt_populate(bo->ttm, &ctx)) {
- ret = VM_FAULT_OOM;
- goto out_io_unlock;
- }
+ if (ttm_tt_populate(bo-...
2014 May 19
8
[PATCH 0/4] drm/ttm: nouveau: memory coherency fixes for ARM
This small series introduces TTM helper functions as well as Nouveau hooks that
are needed to ensure buffer coherency on ARM. Most of this series is a
forward-port of some patches Lucas Stach sent last year and that are also
needed for Nouveau GK20A support:
http://lists.freedesktop.org/archives/nouveau/2013-August/014026.html
Another patch takes care of flushing the CPU write-buffer when
2019 Nov 20
2
Move io_reserve_lru handling into the driver
Just a gentle ping on this.
Already got the Acked-by from Daniel, but I need some of the
nouveau guys to test this since I can only compile test it.
Regards,
Christian.
2013 Aug 28
11
[PATCH 0/6] Nouveau on ARM fixes
This is the first set of patches to make Nouveau work
on Tegra. Those are only the obvious correctness fixes,
a lot of optimization work remains to be done, but at least
it's enough to get accel working and let the machine survive
a piglit run.
A new BO flag is introduced to allow userspace to hint the
kernel about possible optimizations.
Lucas Stach (6):
drm/ttm: recognize ARM arch in
2018 Aug 13
5
[PATCH 0/2] Provide init/release functions for struct ttm_bo_global
TTM uses global memory and BO for backing graphics buffers. These are
represented by struct ttm_mem_global and struct ttm_bo_global.
Currently, struct ttm_bo_global can only be initialized and released through
struct ttm_bo_global_ref. This is a workaround for passing an instance of
ttm_mem_global to the BO global initialization code.
The use of struct ttm_bo_global_ref makes driver code
2018 Aug 13
5
[PATCH 0/2] Provide init/release functions for struct ttm_bo_global
TTM uses global memory and BO for backing graphics buffers. These are
represented by struct ttm_mem_global and struct ttm_bo_global.
Currently, struct ttm_bo_global can only be initialized and released through
struct ttm_bo_global_ref. This is a workaround for passing an instance of
ttm_mem_global to the BO global initialization code.
The use of struct ttm_bo_global_ref makes driver code
2018 Aug 13
5
[PATCH 0/2] Provide init/release functions for struct ttm_bo_global
TTM uses global memory and BO for backing graphics buffers. These are
represented by struct ttm_mem_global and struct ttm_bo_global.
Currently, struct ttm_bo_global can only be initialized and released through
struct ttm_bo_global_ref. This is a workaround for passing an instance of
ttm_mem_global to the BO global initialization code.
The use of struct ttm_bo_global_ref makes driver code
2018 Oct 16
3
[PATCH 0/2][RESEND] Provide init/release functions for struct ttm_bo_global
TTM uses global memory and BO for backing graphics buffers. These are
represented by struct ttm_mem_global and struct ttm_bo_global.
Currently, struct ttm_bo_global can only be initialized and released through
struct ttm_bo_global_ref. This is a workaround for passing an instance of
ttm_mem_global to the BO global initialization code.
The use of struct ttm_bo_global_ref makes driver code