<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c, branch v5.19</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.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-05-26T18:56:34Z</updated>
<entry>
<title>drm/amdgpu: Convert to common fdinfo format v5</title>
<updated>2022-05-26T18:56:34Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-05-11T09:06:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=af0b541670090e87996e0894bd0e457edf617541'/>
<id>urn:sha1:af0b541670090e87996e0894bd0e457edf617541</id>
<content type='text'>
Convert fdinfo format to one documented in drm-usage-stats.rst.

It turned out that the existing implementation was actually completely
nonsense. The calculated percentages indeed represented the usage of the
engine, but with varying time slices.

So 10% usage for application A could mean something completely different
than 10% usage for application B.

Completely nuke that and just use the now standardized nanosecond
interface.

v2: drop the documentation change for now, nuke percentage calculation
v3: only account for each hw_ip, move the time_spend to the ctx mgr.
v4: move general ctx changes into separate patch, rework the fdinfo to
    ctx_mgr interface so that all usages are calculated at once, drop
    some unecessary and dangerous refcount dance.
v5: add one more comment how we calculate the time spend

Signed-off-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Shashank Sharma &lt;shashank.sharma@amd.com&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: cleanup ctx implementation</title>
<updated>2022-05-26T18:56:31Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-05-13T11:54:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=69493c034d2455204dfcd370de8c4dc204374a94'/>
<id>urn:sha1:69493c034d2455204dfcd370de8c4dc204374a94</id>
<content type='text'>
Let each context have a pointer to the ctx manager and properly
initialize the adev pointer inside the context manager.

Reduce the BUG_ON() in amdgpu_ctx_add_fence() into a WARN_ON() and
directly return the sequence number instead of writing into a parmeter.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Shashank Sharma &lt;shashank.sharma@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'amd-drm-next-5.19-2022-05-18' of https://gitlab.freedesktop.org/agd5f/linux into drm-next</title>
<updated>2022-05-19T04:09:54Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2022-05-19T04:09:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=00df0514ab13813655a6fbaba85425f8f4780be2'/>
<id>urn:sha1:00df0514ab13813655a6fbaba85425f8f4780be2</id>
<content type='text'>
amd-drm-next-5.19-2022-05-18:

amdgpu:
- Misc code cleanups
- Additional SMU 13.x enablement
- Smartshift fixes
- GFX11 fixes
- Support for SMU 13.0.4
- SMU mutex fix
- Suspend/resume fix

amdkfd:
- static checker fix
- Doorbell/MMIO resource handling fix

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
From: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220518205621.5741-1-alexander.deucher@amd.com
</content>
</entry>
<entry>
<title>drm/amdgpu/ctx: only reset stable pstate if the user changed it (v2)</title>
<updated>2022-05-16T14:02:57Z</updated>
<author>
<name>Alex Deucher</name>
<email>alexander.deucher@amd.com</email>
</author>
<published>2022-05-10T14:32:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=505c170b628d76fc3efc1b0cf3da8499f85a9b77'/>
<id>urn:sha1:505c170b628d76fc3efc1b0cf3da8499f85a9b77</id>
<content type='text'>
Check if the requested stable pstate matches the current one before
changing it.  This avoids changing the stable pstate on context
destroy if the user never changed it in the first place via the
IOCTL.

v2: compare the current and requested rather than setting a flag (Lijo)

Fixes: 8cda7a4f96e435 ("drm/amdgpu/UAPI: add new CTX OP to get/set stable pstates")
Reviewed-by: Lijo Lazar &lt;lijo.lazar@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: partial revert "remove ctx-&gt;lock" v2</title>
<updated>2022-04-21T09:26:20Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-04-08T14:22:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=94f4c4965e5513ba624488f4b601d6b385635aec'/>
<id>urn:sha1:94f4c4965e5513ba624488f4b601d6b385635aec</id>
<content type='text'>
This reverts commit 461fa7b0ac565ef25c1da0ced31005dd437883a7.

We are missing some inter dependencies here so re-introduce the lock
until we have figured out what's missing. Just drop/retake it while
adding dependencies.

v2: still drop the lock while adding dependencies

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Tested-by: Mikhail Gavrilov &lt;mikhail.v.gavrilov@gmail.com&gt; (v1)
Fixes: 461fa7b0ac56 ("drm/amdgpu: remove ctx-&gt;lock")
Acked-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220419110633.166236-1-christian.koenig@amd.com
</content>
</entry>
<entry>
<title>drm/amdgpu: install ctx entities with cmpxchg</title>
<updated>2022-03-04T18:03:30Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-02-23T13:35:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d18b8eadd83e3d8d63a45f9479478640dbcfca02'/>
<id>urn:sha1:d18b8eadd83e3d8d63a45f9479478640dbcfca02</id>
<content type='text'>
Since we removed the context lock we need to make sure that not two threads
are trying to install an entity at the same time.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Fixes: 461fa7b0ac565e ("drm/amdgpu: remove ctx-&gt;lock")
Reviewed-by: Andrey Grodzovsky &lt;andrey.grodzovsky@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: remove redundant null check</title>
<updated>2022-03-02T23:40:07Z</updated>
<author>
<name>Weiguo Li</name>
<email>liwg06@foxmail.com</email>
</author>
<published>2022-03-02T16:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3192f1d9b61a59d7c82fef187bffa7281fbdc9f5'/>
<id>urn:sha1:3192f1d9b61a59d7c82fef187bffa7281fbdc9f5</id>
<content type='text'>
Remove the redundant null check since the caller ensures
that 'ctx' is never NULL.

Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Weiguo Li &lt;liwg06@foxmail.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug.</title>
<updated>2022-03-02T23:40:06Z</updated>
<author>
<name>Andrey Grodzovsky</name>
<email>andrey.grodzovsky@amd.com</email>
</author>
<published>2022-03-01T00:03:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=57230f0ce6eda6d47a2029b7b3a39cc5bb63fe32'/>
<id>urn:sha1:57230f0ce6eda6d47a2029b7b3a39cc5bb63fe32</id>
<content type='text'>
Protect with drm_dev_enter/exit

Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Andrey Grodzovsky &lt;andrey.grodzovsky@amd.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: check return status before using stable_pstate</title>
<updated>2022-02-16T21:44:40Z</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2022-02-14T18:22:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eed1a5c74216907f79f7b1af725e570e95bab0ea'/>
<id>urn:sha1:eed1a5c74216907f79f7b1af725e570e95bab0ea</id>
<content type='text'>
Clang static analysis reports this problem
amdgpu_ctx.c:616:26: warning: Assigned value is garbage
  or undefined
  args-&gt;out.pstate.flags = stable_pstate;
                         ^ ~~~~~~~~~~~~~
amdgpu_ctx_stable_pstate can fail without setting
stable_pstate.  So check.

Fixes: 8cda7a4f96e4 ("drm/amdgpu/UAPI: add new CTX OP to get/set stable pstates")
Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: remove ctx-&gt;lock</title>
<updated>2022-02-11T21:19:23Z</updated>
<author>
<name>Ken Xue</name>
<email>Ken.Xue@amd.com</email>
</author>
<published>2022-02-11T21:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=461fa7b0ac565ef25c1da0ced31005dd437883a7'/>
<id>urn:sha1:461fa7b0ac565ef25c1da0ced31005dd437883a7</id>
<content type='text'>
KMD reports a warning on holding a lock from drm_syncobj_find_fence,
when running amdgpu_test case “syncobj timeline test”.

ctx-&gt;lock was designed to prevent concurrent "amdgpu_ctx_wait_prev_fence"
calls and avoid dead reservation lock from GPU reset. since no reservation
lock is held in latest GPU reset any more, ctx-&gt;lock can be simply removed
and concurrent "amdgpu_ctx_wait_prev_fence" call also can be prevented by
PD root bo reservation lock.

call stacks:
=================
//hold lock
amdgpu_cs_ioctl-&gt;amdgpu_cs_parser_init-&gt;mutex_lock(&amp;parser-&gt;ctx-&gt;lock);
…
//report warning
amdgpu_cs_dependencies-&gt;amdgpu_cs_process_syncobj_timeline_in_dep \
-&gt;amdgpu_syncobj_lookup_and_add_to_sync -&gt; drm_syncobj_find_fence \
-&gt; lockdep_assert_none_held_once
…
amdgpu_cs_ioctl-&gt;amdgpu_cs_parser_fini-&gt;mutex_unlock(&amp;parser-&gt;ctx-&gt;lock);

Signed-off-by: Ken Xue &lt;Ken.Xue@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
</feed>
