Displaying 20 results from an estimated 22 matches for "ttm_kmap_obj_to_dma_buf_map".
2020 Sep 29
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...include <drm/drm_vma_manager.h>
+#include <linux/dma-buf-map.h>
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/wait.h>
@@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
return map->virtual;
}
+/**
+ * ttm_kmap_obj_to_dma_buf_map
+ *
+ * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
+ * @map: Returns the mapping 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_t...
2020 Sep 29
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...<linux/kref.h>
> > #include <linux/list.h>
> > #include <linux/wait.h>
> > @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
> > return map->virtual;
> > }
> >
> > +/**
> > + * ttm_kmap_obj_to_dma_buf_map
> > + *
> > + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
> > + * @map: Returns the mapping 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...
2020 Sep 30
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...gt; ? #include <linux/list.h>
>>> ? #include <linux/wait.h>
>>> @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct
>>> ttm_bo_kmap_obj *map,
>>> ????? return map->virtual;
>>> ? }
>>> ? +/**
>>> + * ttm_kmap_obj_to_dma_buf_map
>>> + *
>>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
>>> + * @map: Returns the mapping as struct dma_buf_map
>>> + *
>>> + * Converts struct ttm_bo_kmap_obj to struct dma_buf_map. If the memory
>>> + * is not mapped, the re...
2020 Sep 29
3
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...;linux/dma-buf-map.h>
> #include <linux/kref.h>
> #include <linux/list.h>
> #include <linux/wait.h>
> @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
> return map->virtual;
> }
>
> +/**
> + * ttm_kmap_obj_to_dma_buf_map
> + *
> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
> + * @map: Returns the mapping 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.
> + */...
2020 Sep 29
3
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...;linux/dma-buf-map.h>
> #include <linux/kref.h>
> #include <linux/list.h>
> #include <linux/wait.h>
> @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
> return map->virtual;
> }
>
> +/**
> + * ttm_kmap_obj_to_dma_buf_map
> + *
> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
> + * @map: Returns the mapping 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.
> + */...
2020 Sep 29
3
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...;linux/dma-buf-map.h>
> #include <linux/kref.h>
> #include <linux/list.h>
> #include <linux/wait.h>
> @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
> return map->virtual;
> }
>
> +/**
> + * ttm_kmap_obj_to_dma_buf_map
> + *
> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
> + * @map: Returns the mapping 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.
> + */...
2020 Sep 29
1
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...nclude <linux/kref.h>
>> ? #include <linux/list.h>
>> ? #include <linux/wait.h>
>> @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct
>> ttm_bo_kmap_obj *map,
>> ????? return map->virtual;
>> ? }
>> ? +/**
>> + * ttm_kmap_obj_to_dma_buf_map
>> + *
>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
>> + * @map: Returns the mapping 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 initia...
2020 Sep 30
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...>>> @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct
>>>>>>> ttm_bo_kmap_obj *map,
>>>>>>> ????? return map->virtual;
>>>>>>> ? }
>>>>>>> ? +/**
>>>>>>> + * ttm_kmap_obj_to_dma_buf_map
>>>>>>> + *
>>>>>>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
>>>>>>> + * @map: Returns the mapping as struct dma_buf_map
>>>>>>> + *
>>>>>>> + * Converts struct ttm_bo_kmap...
2020 Sep 30
1
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...; ? #include <linux/wait.h>
>>>>> @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct
>>>>> ttm_bo_kmap_obj *map,
>>>>> ????? return map->virtual;
>>>>> ? }
>>>>> ? +/**
>>>>> + * ttm_kmap_obj_to_dma_buf_map
>>>>> + *
>>>>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
>>>>> + * @map: Returns the mapping as struct dma_buf_map
>>>>> + *
>>>>> + * Converts struct ttm_bo_kmap_obj to struct dma_buf_map. If the memor...
2020 Sep 30
2
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...x/list.h>
>>>> ? #include <linux/wait.h>
>>>> @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct
>>>> ttm_bo_kmap_obj *map,
>>>> ????? return map->virtual;
>>>> ? }
>>>> ? +/**
>>>> + * ttm_kmap_obj_to_dma_buf_map
>>>> + *
>>>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
>>>> + * @map: Returns the mapping as struct dma_buf_map
>>>> + *
>>>> + * Converts struct ttm_bo_kmap_obj to struct dma_buf_map. If the memory
>>>> +...
2020 Oct 07
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...seems to require a reimplementation
> of the existing ttm_bo_kmap() code. That is it's own patch series.
>
> I'd rather go with some variant of the existing patch and add
> ttm_bo_vmap() in a follow-up.
ttm_bo_vmap would simply wrap what you currently open-code as
ttm_bo_kmap + ttm_kmap_obj_to_dma_buf_map. Removing ttm_kmap_obj would
be a much later step. Why do you think adding ttm_bo_vmap is not
possible?
-Daniel
> Best regards
> Thomas
>
> >
> > I think for the immediate need of rolling this out for vram helpers and
> > fbdev code we should be able to do this, but jus...
2020 Sep 30
1
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...> > @@ -486,6 +487,29 @@ static inline void *ttm_kmap_obj_virtual(struct
> > > > > > ttm_bo_kmap_obj *map,
> > > > > > ????? return map->virtual;
> > > > > > ? }
> > > > > > ? +/**
> > > > > > + * ttm_kmap_obj_to_dma_buf_map
> > > > > > + *
> > > > > > + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
> > > > > > + * @map: Returns the mapping as struct dma_buf_map
> > > > > > + *
> > > > > > + * Converts struct ttm_bo...
2020 Oct 07
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...of the existing ttm_bo_kmap() code. That is it's own patch series.
>>>
>>> I'd rather go with some variant of the existing patch and add
>>> ttm_bo_vmap() in a follow-up.
>> ttm_bo_vmap would simply wrap what you currently open-code as
>> ttm_bo_kmap + ttm_kmap_obj_to_dma_buf_map. Removing ttm_kmap_obj would
>> be a much later step. Why do you think adding ttm_bo_vmap is not
>> possible?
> The calls to ttm_bo_kmap/_kunmap() require an instance of struct
> ttm_bo_kmap_obj that is stored in each driver's private bo structure
> (e.g., struct drm_gem_vr...
2020 Oct 02
0
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...id *ttm_kmap_obj_virtual(struct
> > >>>>>>> ttm_bo_kmap_obj *map,
> > >>>>>>> return map->virtual;
> > >>>>>>> }
> > >>>>>>> +/**
> > >>>>>>> + * ttm_kmap_obj_to_dma_buf_map
> > >>>>>>> + *
> > >>>>>>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
> > >>>>>>> + * @map: Returns the mapping as struct dma_buf_map
> > >>>>>>> + *
> > >>&g...
2020 Oct 07
1
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...ap() code. That is it's own patch series.
> >>>
> >>> I'd rather go with some variant of the existing patch and add
> >>> ttm_bo_vmap() in a follow-up.
> >> ttm_bo_vmap would simply wrap what you currently open-code as
> >> ttm_bo_kmap + ttm_kmap_obj_to_dma_buf_map. Removing ttm_kmap_obj would
> >> be a much later step. Why do you think adding ttm_bo_vmap is not
> >> possible?
> > The calls to ttm_bo_kmap/_kunmap() require an instance of struct
> > ttm_bo_kmap_obj that is stored in each driver's private bo structure
> >...
2020 Oct 02
1
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...obj_virtual(struct
>>>>>>>>>> ttm_bo_kmap_obj *map,
>>>>>>>>>> return map->virtual;
>>>>>>>>>> }
>>>>>>>>>> +/**
>>>>>>>>>> + * ttm_kmap_obj_to_dma_buf_map
>>>>>>>>>> + *
>>>>>>>>>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
>>>>>>>>>> + * @map: Returns the mapping as struct dma_buf_map
>>>>>>>>>> + *
>>>...
2020 Oct 07
2
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...tion
>> of the existing ttm_bo_kmap() code. That is it's own patch series.
>>
>> I'd rather go with some variant of the existing patch and add
>> ttm_bo_vmap() in a follow-up.
>
> ttm_bo_vmap would simply wrap what you currently open-code as
> ttm_bo_kmap + ttm_kmap_obj_to_dma_buf_map. Removing ttm_kmap_obj would
> be a much later step. Why do you think adding ttm_bo_vmap is not
> possible?
The calls to ttm_bo_kmap/_kunmap() require an instance of struct
ttm_bo_kmap_obj that is stored in each driver's private bo structure
(e.g., struct drm_gem_vram_object, struct rade...
2020 Oct 07
2
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...ap_obj_virtual(struct
>>>>>>>>>> ttm_bo_kmap_obj *map,
>>>>>>>>>> return map->virtual;
>>>>>>>>>> }
>>>>>>>>>> +/**
>>>>>>>>>> + * ttm_kmap_obj_to_dma_buf_map
>>>>>>>>>> + *
>>>>>>>>>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
>>>>>>>>>> + * @map: Returns the mapping as struct dma_buf_map
>>>>>>>>>> + *
>>>...
2020 Sep 30
3
[PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion
...87,29 @@ static inline void *ttm_kmap_obj_virtual(struct
> >>>>>>> ttm_bo_kmap_obj *map,
> >>>>>>> return map->virtual;
> >>>>>>> }
> >>>>>>> +/**
> >>>>>>> + * ttm_kmap_obj_to_dma_buf_map
> >>>>>>> + *
> >>>>>>> + * @kmap: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
> >>>>>>> + * @map: Returns the mapping as struct dma_buf_map
> >>>>>>> + *
> >>>>>>> + * Co...
2020 Sep 29
0
[PATCH v3 3/7] drm/gem: Use struct dma_buf_map in GEM vmap ops and convert GEM backends
..._buf_map *map)
{
struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
int ret;
@@ -58,19 +59,20 @@ void *amdgpu_gem_prime_vmap(struct drm_gem_object *obj)
ret = ttm_bo_kmap(&bo->tbo, 0, bo->tbo.num_pages,
&bo->dma_buf_vmap);
if (ret)
- return ERR_PTR(ret);
+ return ret;
+ ttm_kmap_obj_to_dma_buf_map(&bo->dma_buf_vmap, map);
- return bo->dma_buf_vmap.virtual;
+ return 0;
}
/**
* amdgpu_gem_prime_vunmap - &dma_buf_ops.vunmap implementation
* @obj: GEM BO
- * @vaddr: Virtual address (unused)
+ * @map: Virtual address (unused)
*
* Tears down the in-kernel virtual mappin...