<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/etnaviv/etnaviv_buffer.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-12-03T11:45:05Z</updated>
<entry>
<title>drm/etnaviv: fix flush sequence logic</title>
<updated>2025-12-03T11:45:05Z</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=38007a71ae4775ecda679edd50e4d4b405559829'/>
<id>urn:sha1:38007a71ae4775ecda679edd50e4d4b405559829</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-14T18:44:44Z</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=f145c9924c8a4bb655c860defbb55f27fc069bd1'/>
<id>urn:sha1:f145c9924c8a4bb655c860defbb55f27fc069bd1</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: return context from etnaviv_iommu_context_get</title>
<updated>2021-09-22T10:26:39Z</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=a9bacefda0318e661685a9d3f4137b02d8d090c6'/>
<id>urn:sha1:a9bacefda0318e661685a9d3f4137b02d8d090c6</id>
<content type='text'>
commit 78edefc05e41352099ffb8f06f8d9b2d091e29cd upstream.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: fix TS cache flushing on GPUs with BLT engine</title>
<updated>2020-09-05T09:22:50Z</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=538caddbe635d3ca18e0f02276e76c124eb3c604'/>
<id>urn:sha1:538caddbe635d3ca18e0f02276e76c124eb3c604</id>
<content type='text'>
commit f232d9ec029ce3e2543b05213e2979e01e503408 upstream.

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;
Cc: Walter Lozano &lt;walter.lozano@collabora.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</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>
<entry>
<title>drm/etnaviv: split out cmdbuf mapping into address space</title>
<updated>2019-08-15T08:55:03Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2019-07-05T17:17:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=db82a0435b8be32d544bbed91c43c2f21b5f4ea7'/>
<id>urn:sha1:db82a0435b8be32d544bbed91c43c2f21b5f4ea7</id>
<content type='text'>
This allows to decouple the cmdbuf suballocator create and mapping
the region into the GPU address space. Allowing multiple AS to share
a single cmdbuf suballoc.

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: drop use of drmP.h</title>
<updated>2019-08-02T17:14:51Z</updated>
<author>
<name>Sam Ravnborg</name>
</author>
<published>2019-06-30T05:21:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6eae41fea75039136707c02cf99431462d590c5f'/>
<id>urn:sha1:6eae41fea75039136707c02cf99431462d590c5f</id>
<content type='text'>
Drop use of the deprecated drmP.h header file.
Fix fallout in all .c files.

The etnaviv_drv.h header file was made self-contained,
and missing includes was then added to the .c files that needed them.
In a few cases the list of include files was sorted.

Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
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: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: etnaviv@lists.freedesktop.org
Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>drm/etnaviv: remove lastctx member from gpu struct</title>
<updated>2018-12-18T10:55:16Z</updated>
<author>
<name>Lucas Stach</name>
</author>
<published>2018-11-22T14:29:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=801c7a1e528623f073c4007cb04d9a817e33b3a4'/>
<id>urn:sha1:801c7a1e528623f073c4007cb04d9a817e33b3a4</id>
<content type='text'>
It only written and we don't infer any useful information from
it anymore. Remove it.

Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Reviewed-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
</content>
</entry>
</feed>
