Displaying 20 results from an estimated 166 matches for "is_iomem".
2020 Sep 29
3
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...; + * Converts struct ttm_bo_kmap_obj to struct dma_buf_map. If the memory
> + * is not mapped, the returned mapping is initialized to NULL.
> + */
> +static inline void ttm_kmap_obj_to_dma_buf_map(struct ttm_bo_kmap_obj *kmap,
> + struct dma_buf_map *map)
> +{
> + bool is_iomem;
> + void *vaddr = ttm_kmap_obj_virtual(kmap, &is_iomem);
> +
> + if (!vaddr)
> + dma_buf_map_clear(map);
> + else if (is_iomem)
> + dma_buf_map_set_vaddr_iomem(map, (void __force __iomem *)vaddr);
> + else
> + dma_buf_map_set_vaddr(map, vaddr);
> +}
> +
>...
2020 Sep 29
3
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...; + * Converts struct ttm_bo_kmap_obj to struct dma_buf_map. If the memory
> + * is not mapped, the returned mapping is initialized to NULL.
> + */
> +static inline void ttm_kmap_obj_to_dma_buf_map(struct ttm_bo_kmap_obj *kmap,
> + struct dma_buf_map *map)
> +{
> + bool is_iomem;
> + void *vaddr = ttm_kmap_obj_virtual(kmap, &is_iomem);
> +
> + if (!vaddr)
> + dma_buf_map_clear(map);
> + else if (is_iomem)
> + dma_buf_map_set_vaddr_iomem(map, (void __force __iomem *)vaddr);
> + else
> + dma_buf_map_set_vaddr(map, vaddr);
> +}
> +
>...
2020 Sep 29
3
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...; + * Converts struct ttm_bo_kmap_obj to struct dma_buf_map. If the memory
> + * is not mapped, the returned mapping is initialized to NULL.
> + */
> +static inline void ttm_kmap_obj_to_dma_buf_map(struct ttm_bo_kmap_obj *kmap,
> + struct dma_buf_map *map)
> +{
> + bool is_iomem;
> + void *vaddr = ttm_kmap_obj_virtual(kmap, &is_iomem);
> +
> + if (!vaddr)
> + dma_buf_map_clear(map);
> + else if (is_iomem)
> + dma_buf_map_set_vaddr_iomem(map, (void __force __iomem *)vaddr);
> + else
> + dma_buf_map_set_vaddr(map, vaddr);
> +}
> +
>...
2020 Sep 29
0
[PATCH v3 1/7] drm/vram-helper: Remove invariant parameters from internal kmap function
The parameters map and is_iomem are always of the same value. Removed them
to prepares the function for conversion to struct dma_buf_map.
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
---
drivers/gpu/drm/drm_gem_vram_helper.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git...
2020 Oct 15
0
[PATCH v4 01/10] drm/vram-helper: Remove invariant parameters from internal kmap function
The parameters map and is_iomem are always of the same value. Removed them
to prepares the function for conversion to struct dma_buf_map.
v4:
* don't check for !kmap->virtual; will always be false
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>...
2020 Sep 30
2
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...ed, the returned mapping is initialized to NULL.
>>>> + */
>>>> +static inline void ttm_kmap_obj_to_dma_buf_map(struct ttm_bo_kmap_obj
>>>> *kmap,
>>>> +?????????????????????????? struct dma_buf_map *map)
>>>> +{
>>>> +??? bool is_iomem;
>>>> +??? void *vaddr = ttm_kmap_obj_virtual(kmap, &is_iomem);
>>>> +
>>>> +??? if (!vaddr)
>>>> +??????? dma_buf_map_clear(map);
>>>> +??? else if (is_iomem)
>>>> +??????? dma_buf_map_set_vaddr_iomem(map, (void __force __...
2016 Jul 13
1
[PATCH 1/2] ttm: remove special handling of coherent objects
...ruct ttm_dma_tt *)nvbo->bo.ttm;
- m = dma_tt->cpu_address[index / PAGE_SIZE];
- m += index % PAGE_SIZE;
- }
-
- return m;
-}
-#define nouveau_bo_mem_index(o, i, m) _nouveau_bo_mem_index(o, i, m, sizeof(*m))
-
void
nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val)
{
bool is_iomem;
u16 *mem = ttm_kmap_obj_virtual(&nvbo->kmap, &is_iomem);
- mem = nouveau_bo_mem_index(nvbo, index, mem);
+ mem += index;
if (is_iomem)
iowrite16_native(val, (void __force __iomem *)mem);
@@ -548,7 +515,7 @@ nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index)
bool is_io...
2020 Sep 29
1
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
..._buf_map. If the memory
>> + * is not mapped, the returned mapping is initialized to NULL.
>> + */
>> +static inline void ttm_kmap_obj_to_dma_buf_map(struct ttm_bo_kmap_obj
>> *kmap,
>> +?????????????????????????? struct dma_buf_map *map)
>> +{
>> +??? bool is_iomem;
>> +??? void *vaddr = ttm_kmap_obj_virtual(kmap, &is_iomem);
>> +
>> +??? if (!vaddr)
>> +??????? dma_buf_map_clear(map);
>> +??? else if (is_iomem)
>> +??????? dma_buf_map_set_vaddr_iomem(map, (void __force __iomem *)vaddr);
>> +??? else
>> +???...
2020 Sep 30
1
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...happens here is that we already convert from ttm_bus_placement to
> ttm_bo_kmap_obj and then to dma_buf_map.
Hm I'm not really seeing how that helps with a gradual conversion of
everything over to dma_buf_map and assorted helpers for access? There's
too many places in ttm drivers where is_iomem and related stuff is used to
be able to convert it all in one go. An intermediate state with a bunch of
conversions seems fairly unavoidable to me.
-Daniel
>
> Thanks,
> Christian.
>
> >
> > Best regards
> > Thomas
> >
> > > Regards,
> > >...
2020 Sep 29
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...e could completely drop that if we use the same structure inside TTM as
> well.
> Additional to that which driver is going to use this?
Patch 3 in this series.
I also think this makes sense for gradual conversion:
1. add this helper
2. convert over all users of vmap, this should get rid of is_iomem
flags (and will probably result in a pile of small additions to
dma-buf-map.h)
3. push the struct dma_buf_map down into ttm drivers
Cheers, Daniel
> Regards,
> Christian.
>
> >
> > Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> > ---
> > inclu...
2020 Sep 30
1
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...is initialized to NULL.
>>>>> + */
>>>>> +static inline void ttm_kmap_obj_to_dma_buf_map(struct ttm_bo_kmap_obj
>>>>> *kmap,
>>>>> +?????????????????????????? struct dma_buf_map *map)
>>>>> +{
>>>>> +??? bool is_iomem;
>>>>> +??? void *vaddr = ttm_kmap_obj_virtual(kmap, &is_iomem);
>>>>> +
>>>>> +??? if (!vaddr)
>>>>> +??????? dma_buf_map_clear(map);
>>>>> +??? else if (is_iomem)
>>>>> +??????? dma_buf_map_set_vaddr_iom...
2014 Oct 27
4
[PATCH v5 0/4] drm: nouveau: memory coherency on ARM
It has been a couple of months since v4 - apologies for this. v4 has not
received many comments, but this version addresses them and makes a new
attempt at pushing the critical bit for GK20A and Nouveau on ARM in
general.
As a reminder, this series addresses the memory coherency issue that we
are seeing on ARM platforms. Contrary to x86 which invalidates the PCI
caches whenever a write is made by
2020 Sep 30
3
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...rt from ttm_bus_placement to
> >> ttm_bo_kmap_obj and then to dma_buf_map.
> > Hm I'm not really seeing how that helps with a gradual conversion of
> > everything over to dma_buf_map and assorted helpers for access? There's
> > too many places in ttm drivers where is_iomem and related stuff is used to
> > be able to convert it all in one go. An intermediate state with a bunch of
> > conversions seems fairly unavoidable to me.
>
> Fair enough. I would just have started bottom up and not top down.
>
> Anyway feel free to go ahead with this appro...
2020 Sep 29
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...pping as struct dma_buf_map
+ *
+ * Converts struct ttm_bo_kmap_obj to struct dma_buf_map. If the memory
+ * is not mapped, the returned mapping is initialized to NULL.
+ */
+static inline void ttm_kmap_obj_to_dma_buf_map(struct ttm_bo_kmap_obj *kmap,
+ struct dma_buf_map *map)
+{
+ bool is_iomem;
+ void *vaddr = ttm_kmap_obj_virtual(kmap, &is_iomem);
+
+ if (!vaddr)
+ dma_buf_map_clear(map);
+ else if (is_iomem)
+ dma_buf_map_set_vaddr_iomem(map, (void __force __iomem *)vaddr);
+ else
+ dma_buf_map_set_vaddr(map, vaddr);
+}
+
/**
* ttm_bo_kmap
*
diff --git a/include/linux/dma-b...
2009 Aug 18
1
[PATCH 1/2] drm/nouveau: minor gem cleanups
Signed-off-by: Pekka Paalanen <pq at iki.fi>
---
drivers/gpu/drm/nouveau/nouveau_gem.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 64e59fb..75cae79 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -595,7 +595,7 @@
2020 Oct 02
2
[PATCH v3 6/7] drm/fb_helper: Support framebuffers in I/O memory
...e_t drm_fbdev_fb_read(struct fb_info *info, char __user *buf,
> + size_t count, loff_t *ppos)
> +{
> + struct drm_fb_helper *fb_helper = info->par;
> + struct drm_client_buffer *buffer = fb_helper->buffer;
> +
> + if (drm_fbdev_use_shadow_fb(fb_helper) || !buffer->map.is_iomem)
> + return drm_fb_helper_sys_read(info, buf, count, ppos);
> + else
> + return drm_fb_helper_cfb_read(info, buf, count, ppos);
> +}
> +
> +static ssize_t drm_fbdev_fb_write(struct fb_info *info, const char __user *buf,
> + size_t count, loff_t *ppos)
> +{
> + stru...
2019 May 06
0
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...s from checkpatch.pl
* removed several fixed-size types from interfaces
* DRM_VRAM_HELPER now selects DRM_TTM
* remove separate config option for GEM VRAM
v2:
* rename to |struct drm_gem_vram_object|
* move drm_is_gem_ttm() to a later patch in the series
* add drm_gem_vram_kmap_at()
* return is_iomem from kmap functions
* redefine TTM placement flags for public interface
* documentation fixes
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
---
Documentation/gpu/drm-mm.rst | 15 +
drivers/gpu/drm/Kconfig | 7 +
drivers/gpu/drm/Makefile...
2019 Apr 29
0
[PATCH v3 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...the names of several data types. The helpers are
currently build with TTM, but this is considered an implementation
detail and may change in future updates.
v2:
* rename to |struct drm_gem_vram_object|
* move drm_is_gem_ttm() to a later patch in the series
* add drm_gem_vram_kmap_at()
* return is_iomem from kmap functions
* redefine TTM placement flags for public interface
* documentation fixes
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
---
Documentation/gpu/drm-mm.rst | 12 +
drivers/gpu/drm/Kconfig | 13 +
drivers/gpu/drm/Makefile...
2020 Oct 07
2
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...>>>>> ttm_bo_kmap_obj and then to dma_buf_map.
>>>> Hm I'm not really seeing how that helps with a gradual conversion of
>>>> everything over to dma_buf_map and assorted helpers for access? There's
>>>> too many places in ttm drivers where is_iomem and related stuff is used to
>>>> be able to convert it all in one go. An intermediate state with a bunch of
>>>> conversions seems fairly unavoidable to me.
>>>
>>> Fair enough. I would just have started bottom up and not top down.
>>>
>>>...
2020 Sep 30
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...>> + * is not mapped, the returned mapping is initialized to NULL.
>>> + */
>>> +static inline void ttm_kmap_obj_to_dma_buf_map(struct ttm_bo_kmap_obj
>>> *kmap,
>>> +?????????????????????????? struct dma_buf_map *map)
>>> +{
>>> +??? bool is_iomem;
>>> +??? void *vaddr = ttm_kmap_obj_virtual(kmap, &is_iomem);
>>> +
>>> +??? if (!vaddr)
>>> +??????? dma_buf_map_clear(map);
>>> +??? else if (is_iomem)
>>> +??????? dma_buf_map_set_vaddr_iomem(map, (void __force __iomem *)vaddr);
>>...