<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h, branch v5.18.16</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.18.16</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.18.16'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-04-21T09:26:20+00:00</updated>
<entry>
<title>drm/amdgpu: partial revert "remove ctx-&gt;lock" v2</title>
<updated>2022-04-21T09:26:20+00:00</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2022-04-08T14:22:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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: remove ctx-&gt;lock</title>
<updated>2022-02-11T21:19:23+00:00</updated>
<author>
<name>Ken Xue</name>
<email>Ken.Xue@amd.com</email>
</author>
<published>2022-02-11T21:18:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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>
<entry>
<title>drm/amdgpu/UAPI: add new CTX OP to get/set stable pstates</title>
<updated>2022-01-27T20:50:08+00:00</updated>
<author>
<name>Alex Deucher</name>
<email>alexander.deucher@amd.com</email>
</author>
<published>2022-01-07T22:57:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8cda7a4f96e435be2fd074009d69521d973d7d31'/>
<id>urn:sha1:8cda7a4f96e435be2fd074009d69521d973d7d31</id>
<content type='text'>
Add a new CTX ioctl operation to set stable pstates for profiling.
When creating traces for tools like RGP or using SPM or doing
performance profiling, it's required to enable a special
stable profiling power state on the GPU.  These profiling
states set fixed clocks and disable certain other power
features like powergating which may impact the results.

Historically, these profiling pstates were enabled via sysfs,
but this adds an interface to enable it via the CTX ioctl
from the application.  Since the power state is global
only one application can set it at a time, so if multiple
applications try and use it only the first will get it,
the ioctl will return -EBUSY for others.  The sysfs interface
will override whatever has been set by this interface.

Mesa MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/207

v2: don't default r = 0;
v3: rebase on Evan's PM cleanup

Reviewed-by: Evan Quan &lt;evan.quan@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: rework context priority handling</title>
<updated>2021-09-01T20:55:11+00:00</updated>
<author>
<name>Nirmoy Das</name>
<email>nirmoy.das@amd.com</email>
</author>
<published>2021-08-24T18:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84d588c3de84d07ef83608b60faa4fffdea32aad'/>
<id>urn:sha1:84d588c3de84d07ef83608b60faa4fffdea32aad</id>
<content type='text'>
To get a hardware queue priority for a context, we are currently
mapping AMDGPU_CTX_PRIORITY_* to DRM_SCHED_PRIORITY_* and then
to hardware queue priority, which is not the right way to do that
as DRM_SCHED_PRIORITY_* is software scheduler's priority and it is
independent from a hardware queue priority.

Use userspace provided context priority, AMDGPU_CTX_PRIORITY_* to
map a context to proper hardware queue priority.

Signed-off-by: Nirmoy Das &lt;nirmoy.das@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>
<entry>
<title>drm/amdgpu: fix fence calculation (v2)</title>
<updated>2021-05-13T18:09:12+00:00</updated>
<author>
<name>David M Nieto</name>
<email>david.nieto@amd.com</email>
</author>
<published>2021-05-13T17:45:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5c439c38f5fb8fd16b65af4d5bc4618d1ec9bca3'/>
<id>urn:sha1:5c439c38f5fb8fd16b65af4d5bc4618d1ec9bca3</id>
<content type='text'>
The proper metric for fence utilization over several
contexts is an harmonic mean, but such calculation is
prohibitive in kernel space, so the code approximates it.

Because the approximation diverges when one context has a
very small ratio compared with the other context, this change
filter out ratios smaller that 0.01%

v2: make the fence calculation static and initialize variables
within that function

v3: Fix warnings (Alex)

Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: David M Nieto &lt;david.nieto@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210513174539.27409-2-david.nieto@amd.com
</content>
</entry>
<entry>
<title>drm/amdgpu: Add show_fdinfo() interface</title>
<updated>2021-05-05T07:26:53+00:00</updated>
<author>
<name>Roy Sun</name>
<email>Roy.Sun@amd.com</email>
</author>
<published>2021-04-26T06:27:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=874442541133f78c78b6880b8cc495bab5c61704'/>
<id>urn:sha1:874442541133f78c78b6880b8cc495bab5c61704</id>
<content type='text'>
Tracking devices, process info and fence info using
/proc/pid/fdinfo

Signed-off-by: David M Nieto &lt;David.Nieto@amd.com&gt;
Signed-off-by: Roy Sun &lt;Roy.Sun@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210426062701.39732-2-Roy.Sun@amd.com
</content>
</entry>
<entry>
<title>drm/amdgpu: rework sched_list generation</title>
<updated>2020-04-09T14:43:14+00:00</updated>
<author>
<name>Nirmoy Das</name>
<email>nirmoy.das@amd.com</email>
</author>
<published>2020-04-01T09:46:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1c6d567bdf73a207f51ef2e5745854ba7daa22c7'/>
<id>urn:sha1:1c6d567bdf73a207f51ef2e5745854ba7daa22c7</id>
<content type='text'>
Generate HW IP's sched_list in amdgpu_ring_init() instead of
amdgpu_ctx.c. This makes amdgpu_ctx_init_compute_sched(),
ring.has_high_prio and amdgpu_ctx_init_sched() unnecessary.
This patch also stores sched_list for all HW IPs in one big
array in struct amdgpu_device which makes amdgpu_ctx_init_entity()
much more leaner.

v2:
fix a coding style issue
do not use drm hw_ip const to populate amdgpu_ring_type enum

v3:
remove ctx reference and move sched array and num_sched to a struct
use num_scheds to detect uninitialized scheduler list

v4:
use array_index_nospec for user space controlled variables
fix possible checkpatch.pl warnings

Signed-off-by: Nirmoy Das &lt;nirmoy.das@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>
<entry>
<title>drm/amdgpu: allocate entities on demand</title>
<updated>2020-01-30T22:15:42+00:00</updated>
<author>
<name>Nirmoy Das</name>
<email>nirmoy.das@amd.com</email>
</author>
<published>2020-01-21T14:53:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=977f7e1068be60f3cac7d80ab18692341f3b7fc5'/>
<id>urn:sha1:977f7e1068be60f3cac7d80ab18692341f3b7fc5</id>
<content type='text'>
Currently we pre-allocate entities and fences for all the HW IPs on
context creation and some of which are might never be used.

This patch tries to resolve entity/fences wastage by creating entity
only when needed.

v2: allocate memory for entity and fences together

Signed-off-by: Nirmoy Das &lt;nirmoy.das@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>
<entry>
<title>drm/amdgpu: individualize fence allocation per entity</title>
<updated>2020-01-22T21:55:27+00:00</updated>
<author>
<name>Nirmoy Das</name>
<email>nirmoy.das@amd.com</email>
</author>
<published>2020-01-21T12:29:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=63e3ab9a8226c0271e823f32fc1c3de67d142c78'/>
<id>urn:sha1:63e3ab9a8226c0271e823f32fc1c3de67d142c78</id>
<content type='text'>
Allocate fences for each entity and remove ctx-&gt;fences reference as
fences should be bound to amdgpu_ctx_entity instead amdgpu_ctx.

Signed-off-by: Nirmoy Das &lt;nirmoy.das@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>
<entry>
<title>amd/amdgpu: add sched array to IPs with multiple run-queues</title>
<updated>2019-12-18T21:09:12+00:00</updated>
<author>
<name>Nirmoy Das</name>
<email>nirmoy.das@amd.com</email>
</author>
<published>2019-12-16T13:43:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f880799d7fcf0a63ca2295d950cd12f5520251d9'/>
<id>urn:sha1:f880799d7fcf0a63ca2295d950cd12f5520251d9</id>
<content type='text'>
This sched array can be passed on to entity creation routine
instead of manually creating such sched array on every context creation.

v2: squash in missing break fix

Signed-off-by: Nirmoy Das &lt;nirmoy.das@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>
