<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/etnaviv/etnaviv_buffer.c, branch linux-rolling-lts</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-lts</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-lts'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-11-13T20:33:58Z</updated>
<entry>
<title>drm/etnaviv: fix flush sequence logic</title>
<updated>2025-11-13T20:33:58Z</updated>
<author>
<name>Tomeu Vizoso</name>
</author>
<published>2025-10-21T09:37:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8fe83fad4bb66e8909f03ef41e9dd9ba85c20774'/>
<id>urn:sha1:8fe83fad4bb66e8909f03ef41e9dd9ba85c20774</id>
<content type='text'>
[ Upstream commit a042beac6e6f8ac1e923784cfff98b47cbabb185 ]

The current logic uses the flush sequence from the current address
space. This is harmless when deducing the flush requirements for the
current submit, as either the incoming address space is the same one
as the currently active one or we switch context, in which case the
flush is unconditional.

However, this sequence is also stored as the current flush sequence
of the GPU. If we switch context the stored flush sequence will no
longer belong to the currently active address space. This incoherency
can then cause missed flushes, resulting in translation errors.

Fixes: 27b67278e007 ("drm/etnaviv: rework MMU handling")
Signed-off-by: Tomeu Vizoso &lt;tomeu@tomeuvizoso.net&gt;
Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Reviewed-by: Christian Gmeiner &lt;cgmeiner@igalia.com&gt;
Link: https://lore.kernel.org/r/20251021093723.3887980-1-l.stach@pengutronix.de
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: flush shader L1 cache after user commandstream</title>
<updated>2024-12-09T09:41:13Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2024-10-25T15:14:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=96c308559eedcea0563c98fae4d3fee9d84b6b8d'/>
<id>urn:sha1:96c308559eedcea0563c98fae4d3fee9d84b6b8d</id>
<content type='text'>
commit 4f8dbadef085ab447a01a8d4806a3f629fea05ed upstream.

The shader L1 cache is a writeback cache for shader loads/stores
and thus must be flushed before any BOs backing the shader buffers
are potentially freed.

Cc: stable@vger.kernel.org
Reviewed-by: Christian Gmeiner &lt;cgmeiner@igalia.com&gt;
Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: slow down FE idle polling</title>
<updated>2023-06-21T13:18:14Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2023-06-16T11:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=295b6c02f84b81971c42b592771920783fc181cd'/>
<id>urn:sha1:295b6c02f84b81971c42b592771920783fc181cd</id>
<content type='text'>
Currently the FE is spinning way too fast when polling for new work in
the FE idleloop. As each poll fetches 16 bytes from memory, a GPU running
at 1GHz with the current setting of 200 wait cycle between fetches causes
80 MB/s of memory traffic just to check for new work when the GPU is
otherwise idle, which is more FE traffic than in some GPU loaded cases.

Significantly increase the number of wait cycles to slow down the poll
interval to ~30µs, limiting the FE idle memory traffic to 512 KB/s, while
providing a max latency which should not hurt most use-cases. The FE WAIT
command seems to have some unknown discrete steps in the wait cycles so
we may over/undershoot the target a bit, but that should be harmless.

If the GPU core base frequency is unknown keep the 200 wait cycles as
a sane default.

Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Reviewed-by: Sui Jingfeng &lt;suijingfeng@loongson.cn&gt;
Tested-by: Sui Jingfeng &lt;suijingfeng@loongson.cn&gt;
Reviewed-by: Christian Gmeiner &lt;cgmeiner@igalia.com&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: return context from etnaviv_iommu_context_get</title>
<updated>2021-09-16T08:34:59Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2021-08-20T20:18:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=78edefc05e41352099ffb8f06f8d9b2d091e29cd'/>
<id>urn:sha1:78edefc05e41352099ffb8f06f8d9b2d091e29cd</id>
<content type='text'>
Being able to have the refcount manipulation in an assignment makes
it much easier to parse the code.

Cc: stable@vger.kernel.org # 5.4
Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Tested-by: Michael Walle &lt;michael@walle.cc&gt;
Tested-by: Marek Vasut &lt;marex@denx.de&gt;
Reviewed-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: fix TS cache flushing on GPUs with BLT engine</title>
<updated>2020-03-20T17:40:44Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2020-02-26T15:27:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f232d9ec029ce3e2543b05213e2979e01e503408'/>
<id>urn:sha1:f232d9ec029ce3e2543b05213e2979e01e503408</id>
<content type='text'>
As seen in the Vivante kernel driver, most GPUs with the BLT engine have
a broken TS cache flush. The workaround is to temporarily set the BLT
command to CLEAR_IMAGE, without actually executing the clear. Apparently
this state change is enough to trigger the required TS cache flush. As
the BLT engine is completely asychronous, we also need a few more stall
states to synchronize the flush with the frontend.

Root-caused-by: Jonathan Marek &lt;jonathan@marek.ca&gt;
Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>Merge drm/drm-next into drm-misc-next</title>
<updated>2019-10-03T14:38:50Z</updated>
<author>
<name>Maxime Ripard</name>
</author>
<published>2019-10-03T14:38:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4092de1ba34eb376791809fb366bc15f8a9e0b7c'/>
<id>urn:sha1:4092de1ba34eb376791809fb366bc15f8a9e0b7c</id>
<content type='text'>
We haven't done any backmerge for a while due to the merge window, and it
starts to become an issue for komeda. Let's bring 5.4-rc1 in.

Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: use drm_debug_enabled() to check for debug categories</title>
<updated>2019-10-02T13:29:16Z</updated>
<author>
<name>Jani Nikula</name>
</author>
<published>2019-09-24T12:58:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6511a945cf7d49357a60d5b7cd37beddc1301335'/>
<id>urn:sha1:6511a945cf7d49357a60d5b7cd37beddc1301335</id>
<content type='text'>
Allow better abstraction of the drm_debug global variable in the
future. No functional changes.

Cc: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Cc: Russell King &lt;linux+etnaviv@armlinux.org.uk&gt;
Cc: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Cc: etnaviv@lists.freedesktop.org
Acked-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/f202f2cdd7c3176649dadeb48a6da4b208e9e829.1569329774.git.jani.nikula@intel.com
</content>
</entry>
<entry>
<title>drm/etnaviv: implement per-process address spaces on MMUv2</title>
<updated>2019-08-15T09:44:27Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2019-07-05T17:17:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=17e4660ae3d7e14120f0b355d3d1995cd10a3e43'/>
<id>urn:sha1:17e4660ae3d7e14120f0b355d3d1995cd10a3e43</id>
<content type='text'>
This builds on top of the MMU contexts introduced earlier. Instead of having
one context per GPU core, each GPU client receives its own context.

On MMUv1 this still means a single shared pagetable set is used by all
clients, but on MMUv2 there is now a distinct set of pagetables for each
client. As the command fetch is also translated via the MMU on MMUv2 the
kernel command ringbuffer is mapped into each of the client pagetables.

As the MMU context switch is a bit of a heavy operation, due to the needed
cache and TLB flushing, this patch implements a lazy way of switching the
MMU context. The kernel does not have its own MMU context, but reuses the
last client context for all of its operations. This has some visible impact,
as the GPU can now only be started once a client has submitted some work and
we got the client MMU context assigned. Also the MMU context has a different
lifetime than the general client context, as the GPU might still execute the
kernel command buffer in the context of a client even after the client has
completed all GPU work and has been terminated. Only when the GPU is runtime
suspended or switches to another clients MMU context is the old context
freed up.

Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Reviewed-by: Guido Günther &lt;agx@sigxcpu.org&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: rework MMU handling</title>
<updated>2019-08-15T08:56:45Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2019-07-05T17:17:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=27b67278e007b5475bc14918794bf73cf297a026'/>
<id>urn:sha1:27b67278e007b5475bc14918794bf73cf297a026</id>
<content type='text'>
This reworks the MMU handling to make it possible to have multiple MMU contexts.
A context is basically one instance of GPU page tables. Currently we have one
set of page tables per GPU, which isn't all that clever, as it has the
following two consequences:

1. All GPU clients (aka processes) are sharing the same pagetables, which means
there is no isolation between clients, but only between GPU assigned memory
spaces and the rest of the system. Better than nothing, but also not great.

2. Clients operating on the same set of buffers with different etnaviv GPU
cores, e.g. a workload using both the 2D and 3D GPU, need to map the used
buffers into the pagetable sets of each used GPU.

This patch reworks all the MMU handling to introduce the abstraction of the
MMU context. A context can be shared across different GPU cores, as long as
they have compatible MMU implementations, which is the case for all systems
with Vivante GPUs seen in the wild.

As MMUv1 is not able to change pagetables on the fly, without a
"stop the world" operation, which stops GPU, changes pagetables via CPU
interaction, restarts GPU, the implementation introduces a shared context on
MMUv1, which is returned whenever there is a request for a new context.

This patch assigns a MMU context to each GPU, so on MMUv2 systems there is
still one set of pagetables per GPU, but due to the shared context MMUv1
systems see a change in behavior as now a single pagetable set is used
across all GPU cores.

Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Reviewed-by: Guido Günther &lt;agx@sigxcpu.org&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: replace MMU flush marker with flush sequence</title>
<updated>2019-08-15T08:56:03Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2019-07-05T17:17:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4900dda90af2cb13bc1d4c12ce94b98acc8fe64e'/>
<id>urn:sha1:4900dda90af2cb13bc1d4c12ce94b98acc8fe64e</id>
<content type='text'>
If a MMU is shared between multiple GPUs, all of them need to flush their
TLBs, so a single marker that gets reset on the first flush won't do.
Replace the flush marker with a sequence number, so that it's possible to
check if the TLB is in sync with the current page table state for each GPU.

Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Reviewed-by: Guido Günther &lt;agx@sigxcpu.org&gt;
</content>
</entry>
</feed>
