<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/vc4, branch v5.19</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.19</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.19'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-06-27T13:43:14+00:00</updated>
<entry>
<title>drm/vc4: perfmon: Fix variable dereferenced before check</title>
<updated>2022-06-27T13:43:14+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-06-22T08:02:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f701324c0fb6f9f5aaac3f8d1575321375f6d8f'/>
<id>urn:sha1:5f701324c0fb6f9f5aaac3f8d1575321375f6d8f</id>
<content type='text'>
Commit 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711")
introduced a check in vc4_perfmon_get() that dereferences a pointer before
we checked whether that pointer is valid or not.

Let's rework that function a bit to do things in the proper order.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Fixes: 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711")
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220622080243.22119-1-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/vc4: fix error code in vc4_check_tex_size()</title>
<updated>2022-06-22T14:41:30+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2022-06-22T12:25:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3026b5ca06fa872147f9726ca7c1f658bae71abf'/>
<id>urn:sha1:3026b5ca06fa872147f9726ca7c1f658bae71abf</id>
<content type='text'>
The vc4_check_tex_size() function is supposed to return false on error
but this error path accidentally returns -ENODEV (which means true).

Fixes: 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/YrMKK89/viQiaiAg@kili
</content>
</entry>
<entry>
<title>drm/vc4: hdmi: Fixed possible integer overflow</title>
<updated>2022-06-22T07:30:17+00:00</updated>
<author>
<name>Saud Farooqui</name>
<email>farooqui_saud@hotmail.com</email>
</author>
<published>2022-06-09T18:50:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f940e528da6bce52a86fbdf881b76f60240aeaf'/>
<id>urn:sha1:5f940e528da6bce52a86fbdf881b76f60240aeaf</id>
<content type='text'>
Multiplying ints and saving it in unsigned long long
could lead to integer overflow before being type casted to
unsigned long long.

Addresses-Coverity:  1505113: Unintentional integer overflow.

Signed-off-by: Saud Farooqui &lt;farooqui_saud@hotmail.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/PA4P189MB1421E63C0FF3EBF234A80AB38BA79@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM
</content>
</entry>
<entry>
<title>drm/vc4: Warn if some v3d code is run on BCM2711</title>
<updated>2022-06-16T09:07:52+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-06-10T11:51:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=30f8c74ca9b7b3a2db55f6bb1d2e9f8c47a79f94'/>
<id>urn:sha1:30f8c74ca9b7b3a2db55f6bb1d2e9f8c47a79f94</id>
<content type='text'>
The BCM2711 has a separate driver for the v3d, and thus we can't call
into any of the driver entrypoints that rely on the v3d being there.

Let's add a bunch of checks and complain loudly if that ever happen.

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20220610115149.964394-15-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/vc4: crtc: Fix out of order frames during asynchronous page flips</title>
<updated>2022-06-16T09:07:52+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-06-10T11:51:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d19e00ee06a9abf590b178c34cad637a516752f8'/>
<id>urn:sha1:d19e00ee06a9abf590b178c34cad637a516752f8</id>
<content type='text'>
When doing an asynchronous page flip (PAGE_FLIP ioctl with the
DRM_MODE_PAGE_FLIP_ASYNC flag set), the current code waits for the
possible GPU buffer being rendered through a call to
vc4_queue_seqno_cb().

On the BCM2835-37, the GPU driver is part of the vc4 driver and that
function is defined in vc4_gem.c to wait for the buffer to be rendered,
and once it's done, call a callback.

However, on the BCM2711 used on the RaspberryPi4, the GPU driver is
separate (v3d) and that function won't do anything. This was working
because we were going into a path, due to uninitialized variables, that
was always scheduling the callback.

However, we were never actually waiting for the buffer to be rendered
which was resulting in frames being displayed out of order.

The generic API to signal those kind of completion in the kernel are the
DMA fences, and fortunately the v3d drivers supports them and signal
when its job is done. That API also provides an equivalent function that
allows to have a callback being executed when the fence is signalled as
done.

Let's change our driver a bit to rely on the previous function for the
older SoCs, and on DMA fences for the BCM2711.

Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Link: https://lore.kernel.org/r/20220610115149.964394-14-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/vc4: crtc: Don't call into BO Handling on Async Page-Flips on BCM2711</title>
<updated>2022-06-16T09:07:52+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-06-10T11:51:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d87db1c79d6f9ec5505be2ff4ca8811d6e88a667'/>
<id>urn:sha1:d87db1c79d6f9ec5505be2ff4ca8811d6e88a667</id>
<content type='text'>
The BCM2711 doesn't have a v3d GPU so we don't want to call into its BO
management code. Let's create an asynchronous page-flip handler for the
BCM2711 that just calls into the common code.

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20220610115149.964394-13-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/vc4: crtc: Move the BO Handling out of Common Page-Flip Handler</title>
<updated>2022-06-16T09:07:52+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-06-10T11:51:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f6766fb265b18248d2c4bc643eb99e853f293dd6'/>
<id>urn:sha1:f6766fb265b18248d2c4bc643eb99e853f293dd6</id>
<content type='text'>
The function vc4_async_page_flip() handles asynchronous page-flips in
the vc4 driver.

However, it mixes some generic code with code that should only be run on
older generations that have the GPU handled by the vc4 driver.

Let's split the generic part out of vc4_async_page_flip() and into a
common function that we be reusable by an handler made for the BCM2711.

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20220610115149.964394-12-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/vc4: crtc: Move the BO handling out of common page-flip callback</title>
<updated>2022-06-16T09:07:52+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-06-10T11:51:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d12c36fb73b5c49fe2f95d06515fd9846010fd2'/>
<id>urn:sha1:4d12c36fb73b5c49fe2f95d06515fd9846010fd2</id>
<content type='text'>
We'll soon introduce another completion callback source that won't need
to use the BO reference counting, so let's move it around to create a
function we will be able to share between both callbacks.

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20220610115149.964394-11-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/vc4: crtc: Use an union to store the page flip callback</title>
<updated>2022-06-16T09:07:52+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-06-10T11:51:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2523e9dcc3be91bf9fdc0d1e542557ca00bbef42'/>
<id>urn:sha1:2523e9dcc3be91bf9fdc0d1e542557ca00bbef42</id>
<content type='text'>
We'll need to extend the vc4_async_flip_state structure to rely on
another callback implementation, so let's move the current one into a
union.

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20220610115149.964394-10-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/vc4: drv: Skip BO Backend Initialization on BCM2711</title>
<updated>2022-06-16T09:07:52+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-06-10T11:51:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=257add942a477bb99bdf4bacc6190703f796dcff'/>
<id>urn:sha1:257add942a477bb99bdf4bacc6190703f796dcff</id>
<content type='text'>
On the BCM2711, we currently call the vc4_bo_cache_init() and
vc4_gem_init() functions. These functions initialize the BO and GEM
backends.

However, this code was initially created to accomodate the requirements
of the GPU on the older SoCs, while the BCM2711 has a separate driver
for it. So let's just skip these calls when we're on a newer hardware.

Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20220610115149.964394-9-maxime@cerno.tech
</content>
</entry>
</feed>
