<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/drm/ttm, branch v5.12</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.12</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.12'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-03-15T15:02:30Z</updated>
<entry>
<title>drm/ttm: make ttm_bo_unpin more defensive</title>
<updated>2021-03-15T15:02:30Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2021-03-12T08:34:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6c5403173a13a08ff61dbdafa4c0ed4a9dedbfe0'/>
<id>urn:sha1:6c5403173a13a08ff61dbdafa4c0ed4a9dedbfe0</id>
<content type='text'>
We seem to have some more driver bugs than thought.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Fixes: deb0814b43f3 ("drm/ttm: add ttm_bo_pin()/ttm_bo_unpin() v2")
Acked-by: Matthew Auld &lt;matthew.auld@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210312093810.2202-1-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>drm/ttm: WARN_ON non-empty lru when disabling a resource manager</title>
<updated>2021-01-18T13:15:20Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-12-11T16:29:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=72fec10c17d95bcb99371f5b29f6947e67d7493b'/>
<id>urn:sha1:72fec10c17d95bcb99371f5b29f6947e67d7493b</id>
<content type='text'>
ttm_resource_manager-&gt;use_type is only used for runtime changes by
vmwgfx. I think ideally we'd push this functionality into drivers -
ttm itself does not provide any locking to guarantee this is safe, so
the only way this can work at runtime is if the driver does provide
additional guarantees. vwmgfx does that through the
vmw_private-&gt;reservation_sem. Therefore supporting this feature in
shared code feels a bit misplaced.

As a first step add a WARN_ON to make sure the resource manager is
empty. This is just to make sure I actually understand correctly what
vmwgfx is doing, and to make sure an eventual subsequent refactor
doesn't break anything.

This check should also be useful for other drivers, to make sure they
haven't leaked anything.

Reviewed-by: Roland Scheidegger &lt;sroland@vmware.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: Christian Koenig &lt;christian.koenig@amd.com&gt;
Cc: Huang Rui &lt;ray.huang@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20201211162942.3399050-3-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm/ttm: cleanup LRU handling further</title>
<updated>2020-12-15T16:01:55Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2020-11-27T14:14:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3d1a88e1051f5d788d789011823d9accc4e03dad'/>
<id>urn:sha1:3d1a88e1051f5d788d789011823d9accc4e03dad</id>
<content type='text'>
We only completely delete the BO from the LRU on destruction.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Andrey Grodzovsky &lt;andrey.grodzovsky@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/404618/
</content>
</entry>
<entry>
<title>drm/ttm: cleanup BO size handling v3</title>
<updated>2020-12-14T13:20:46Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2020-12-09T14:07:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e11bfb99d6ece23b772b57c29fa80448639fd6e5'/>
<id>urn:sha1:e11bfb99d6ece23b772b57c29fa80448639fd6e5</id>
<content type='text'>
Based on an idea from Dave, but cleaned up a bit.

We had multiple fields for essentially the same thing.

Now bo-&gt;base.size is the original size of the BO in
arbitrary units, usually bytes.

bo-&gt;mem.num_pages is the size in number of pages in the
resource domain of bo-&gt;mem.mem_type.

v2: use the GEM object size instead of the BO size
v3: fix printks in some places

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Huang Rui &lt;ray.huang@amd.com&gt; (v1)
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/406831/
</content>
</entry>
<entry>
<title>drm/ttm/drivers: remove unecessary ttm_module.h include v2</title>
<updated>2020-12-01T16:43:46Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2020-11-17T14:44:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5cf82904264190cd6c0edf65ce144ebb2b8be7f4'/>
<id>urn:sha1:5cf82904264190cd6c0edf65ce144ebb2b8be7f4</id>
<content type='text'>
ttm_module.h deals with internals of TTM and should never
be include outside of it.

v2: also move the file around

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/404885/
</content>
</entry>
<entry>
<title>drm/ttm: nuke ttm_dma_tt_init</title>
<updated>2020-11-30T14:00:34Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2020-11-23T13:56:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18f7608a67fca8b8305b3557e2c00bca54785acd'/>
<id>urn:sha1:18f7608a67fca8b8305b3557e2c00bca54785acd</id>
<content type='text'>
Not used any more.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/403837/
</content>
</entry>
<entry>
<title>drm/ttm: Warn on pinning without holding a reference</title>
<updated>2020-11-27T15:43:54Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-10-28T11:31:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=57fcd550eb15bce14a7154736379dfd4ed60ae81'/>
<id>urn:sha1:57fcd550eb15bce14a7154736379dfd4ed60ae81</id>
<content type='text'>
Not technically a problem for ttm, but very likely a driver bug and
pretty big time confusing for reviewing code.

So warn about it, both at cleanup time (so we catch these for sure)
and at pin/unpin time (so we know who's the culprit).

Reviewed-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: Christian Koenig &lt;christian.koenig@amd.com&gt;
Cc: Huang Rui &lt;ray.huang@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20201028113120.3641237-1-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm/ttm: add multihop infrastrucutre (v3)</title>
<updated>2020-11-11T01:11:03Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2020-10-29T03:58:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ebdf565169af006ee3be8c40eecbfc77d28a3b84'/>
<id>urn:sha1:ebdf565169af006ee3be8c40eecbfc77d28a3b84</id>
<content type='text'>
Currently drivers get called to move a buffer, but if they have to
move it temporarily through another space (SYSTEM-&gt;VRAM via TT)
then they can end up with a lot of ttm-&gt;driver-&gt;ttm call stacks,
if the temprorary space moves requires eviction.

Instead of letting the driver do all the placement/space for the
temporary, allow it to report back (-EMULTIHOP) and a placement (hop)
to the move code, which will then do the temporary move, and the
correct placement move afterwards.

This removes a lot of code from drivers, at the expense of
adding some midlayering. I've some further ideas on how to turn
it inside out, but I think this is a good solution to the call
stack problems.

v2: separate out the driver patches, add WARN for getting
MULTHOP in paths we shouldn't (Daniel)
v3: use memset (Christian)

Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Reviewed-by: hristian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20201109005432.861936-2-airlied@gmail.com
</content>
</entry>
<entry>
<title>drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers</title>
<updated>2020-11-09T08:17:36Z</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2020-11-03T09:30:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43676605f890b218e551f396a55dbaea7799acb4'/>
<id>urn:sha1:43676605f890b218e551f396a55dbaea7799acb4</id>
<content type='text'>
The new functions ttm_bo_{vmap,vunmap}() map and unmap a TTM BO in kernel
address space. The mapping's address is returned as struct dma_buf_map.
Each function is a simplified version of TTM's existing kmap code. Both
functions respect the memory's location ani/or writecombine flags.

On top TTM's functions, GEM TTM helpers got drm_gem_ttm_{vmap,vunmap}(),
two helpers that convert a GEM object into the TTM BO and forward the call
to TTM's vmap/vunmap. These helpers can be dropped into the rsp GEM object
callbacks.

v5:
	* use size_t for storing mapping size (Christian)
	* ignore premapped memory areas correctly in ttm_bo_vunmap()
	* rebase onto latest TTM interfaces (Christian)
	* remove BUG() from ttm_bo_vmap() (Christian)
v4:
	* drop ttm_kmap_obj_to_dma_buf() in favor of vmap helpers (Daniel,
	  Christian)

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Tested-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20201103093015.1063-6-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/ttm: replace context flags with bools v2</title>
<updated>2020-11-04T10:23:25Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2020-11-02T12:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c44dfe4de053914cae61ed0a36421b3017f428bd'/>
<id>urn:sha1:c44dfe4de053914cae61ed0a36421b3017f428bd</id>
<content type='text'>
The ttm_operation_ctx structure has a mixture of flags and bools. Drop the
flags and replace them with bools as well.

v2: fix typos, improve comments

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/398686/
</content>
</entry>
</feed>
