<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/imagination, branch v6.12.22</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.22</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.22'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-03-13T12:02:05+00:00</updated>
<entry>
<title>drm/imagination: Fix timestamps in firmware traces</title>
<updated>2025-03-13T12:02:05+00:00</updated>
<author>
<name>Alessio Belle</name>
<email>alessio.belle@imgtec.com</email>
</author>
<published>2025-02-21T10:49:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ce1436ce15bf1638b239844966e836d46c4eda58'/>
<id>urn:sha1:ce1436ce15bf1638b239844966e836d46c4eda58</id>
<content type='text'>
[ Upstream commit 1d2eabb6616433ccaa13927811bdfa205e91ba60 ]

When firmware traces are enabled, the firmware dumps 48-bit timestamps
for each trace as two 32-bit values, highest 32 bits (of which only 16
useful) first.

The driver was reassembling them the other way round i.e. interpreting
the first value in memory as the lowest 32 bits, and the second value
as the highest 32 bits (then truncated to 16 bits).

Due to this, firmware trace dumps showed very large timestamps even for
traces recorded shortly after GPU boot. The timestamps in these dumps
would also sometimes jump backwards because of the truncation.

Example trace dumped after loading the powervr module and enabling
firmware traces, where each line is commented with the timestamp value
in hexadecimal to better show both issues:

[93540092739584] : Host Sync Partition marker: 1    // 0x551300000000
[28419798597632] : GPU units deinit                 // 0x19d900000000
[28548647616512] : GPU deinit                       // 0x19f700000000

Update logic to reassemble the timestamps halves in the correct order.

Fixes: cb56cd610866 ("drm/imagination: Add firmware trace to debugfs")
Signed-off-by: Alessio Belle &lt;alessio.belle@imgtec.com&gt;
Reviewed-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250221-fix-fw-trace-timestamps-v1-1-dba4aeb030ca@imgtec.com
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/imagination: only init job done fences once</title>
<updated>2025-03-13T12:01:53+00:00</updated>
<author>
<name>Brendan King</name>
<email>Brendan.King@imgtec.com</email>
</author>
<published>2025-02-26T15:43:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e31371dfff93f98de3fd072491c3e84d0736cb8'/>
<id>urn:sha1:3e31371dfff93f98de3fd072491c3e84d0736cb8</id>
<content type='text'>
commit 68c3de7f707e8a70e0a6d8087cf0fe4a3d5dbfb0 upstream.

Ensure job done fences are only initialised once.

This fixes a memory manager not clean warning from drm_mm_takedown
on module unload.

Cc: stable@vger.kernel.org
Fixes: eaf01ee5ba28 ("drm/imagination: Implement job submission and scheduling")
Signed-off-by: Brendan King &lt;brendan.king@imgtec.com&gt;
Reviewed-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250226-init-done-fences-once-v2-1-c1b2f556b329@imgtec.com
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/imagination: Hold drm_gem_gpuva lock for unmap</title>
<updated>2025-03-13T12:01:53+00:00</updated>
<author>
<name>Brendan King</name>
<email>Brendan.King@imgtec.com</email>
</author>
<published>2025-02-26T15:43:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=58e37cfcb12aaf78a4cf899e221950a6f1ced491'/>
<id>urn:sha1:58e37cfcb12aaf78a4cf899e221950a6f1ced491</id>
<content type='text'>
commit a5c4c3ba95a52d66315acdfbaba9bd82ed39c250 upstream.

Avoid a warning from drm_gem_gpuva_assert_lock_held in drm_gpuva_unlink.

The Imagination driver uses the GEM object reservation lock to protect
the gpuva list, but the GEM object was not always known in the code
paths that ended up calling drm_gpuva_unlink. When the GEM object isn't
known, it is found by calling drm_gpuva_find to lookup the object
associated with a given virtual address range, or by calling
drm_gpuva_find_first when removing all mappings.

Cc: stable@vger.kernel.org
Fixes: 4bc736f890ce ("drm/imagination: vm: make use of GPUVM's drm_exec helper")
Signed-off-by: Brendan King &lt;brendan.king@imgtec.com&gt;
Reviewed-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250226-hold-drm_gem_gpuva-lock-for-unmap-v2-1-3fdacded227f@imgtec.com
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/imagination: avoid deadlock on fence release</title>
<updated>2025-03-13T12:01:53+00:00</updated>
<author>
<name>Brendan King</name>
<email>Brendan.King@imgtec.com</email>
</author>
<published>2025-02-26T15:42:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d993ae7360923efd6ade43a32043459a121c28c1'/>
<id>urn:sha1:d993ae7360923efd6ade43a32043459a121c28c1</id>
<content type='text'>
commit df1a1ed5e1bdd9cc13148e0e5549f5ebcf76cf13 upstream.

Do scheduler queue fence release processing on a workqueue, rather
than in the release function itself.

Fixes deadlock issues such as the following:

[  607.400437] ============================================
[  607.405755] WARNING: possible recursive locking detected
[  607.415500] --------------------------------------------
[  607.420817] weston:zfq0/24149 is trying to acquire lock:
[  607.426131] ffff000017d041a0 (reservation_ww_class_mutex){+.+.}-{3:3}, at: pvr_gem_object_vunmap+0x40/0xc0 [powervr]
[  607.436728]
               but task is already holding lock:
[  607.442554] ffff000017d105a0 (reservation_ww_class_mutex){+.+.}-{3:3}, at: dma_buf_ioctl+0x250/0x554
[  607.451727]
               other info that might help us debug this:
[  607.458245]  Possible unsafe locking scenario:

[  607.464155]        CPU0
[  607.466601]        ----
[  607.469044]   lock(reservation_ww_class_mutex);
[  607.473584]   lock(reservation_ww_class_mutex);
[  607.478114]
                *** DEADLOCK ***

Cc: stable@vger.kernel.org
Fixes: eaf01ee5ba28 ("drm/imagination: Implement job submission and scheduling")
Signed-off-by: Brendan King &lt;brendan.king@imgtec.com&gt;
Reviewed-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250226-fence-release-deadlock-v2-1-6fed2fc1fe88@imgtec.com
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/imagination: Use pvr_vm_context_get()</title>
<updated>2024-12-05T13:01:36+00:00</updated>
<author>
<name>Matt Coster</name>
<email>Matt.Coster@imgtec.com</email>
</author>
<published>2024-08-30T15:06:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=54b2f90ad1f519e294b26fa18842487f671947fb'/>
<id>urn:sha1:54b2f90ad1f519e294b26fa18842487f671947fb</id>
<content type='text'>
[ Upstream commit eb4accc5234525e2cb2b720187ccaf6db99b705f ]

I missed this open-coded kref_get() while trying to debug a refcount
bug, so let's use the helper function here to avoid that waste of time
again in the future.

Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code")
Reviewed-by: Frank Binns &lt;frank.binns@imgtec.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/8616641d-6005-4b25-bc0a-0b53985a0e08@imgtec.com
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/imagination: Convert to use time_before macro</title>
<updated>2024-12-05T13:01:35+00:00</updated>
<author>
<name>Chen Yufan</name>
<email>chenyufan@vivo.com</email>
</author>
<published>2024-08-23T09:39:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d968f2c052f46f6a6cf97a0702a191d8deb2e3a7'/>
<id>urn:sha1:d968f2c052f46f6a6cf97a0702a191d8deb2e3a7</id>
<content type='text'>
[ Upstream commit 7a5115ba1d691bd14db91d2fcc3ce0b056574ce9 ]

Use time_*() macros instead of using jiffies directly to handle overflow
issues.

Fixes: cc1aeedb98ad ("drm/imagination: Implement firmware infrastructure and META FW support")
Signed-off-by: Chen Yufan &lt;chenyufan@vivo.com&gt;
Reviewed-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240823093925.9599-1-chenyufan@vivo.com
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/imagination: Break an object reference loop</title>
<updated>2024-11-04T09:41:38+00:00</updated>
<author>
<name>Brendan King</name>
<email>brendan.king@imgtec.com</email>
</author>
<published>2024-10-18T15:41:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b04ce1e718bd55302b52d05d6873e233cb3ec7a1'/>
<id>urn:sha1:b04ce1e718bd55302b52d05d6873e233cb3ec7a1</id>
<content type='text'>
When remaining resources are being cleaned up on driver close,
outstanding VM mappings may result in resources being leaked, due
to an object reference loop, as shown below, with each object (or
set of objects) referencing the object below it:

    PVR GEM Object
    GPU scheduler "finished" fence
    GPU scheduler “scheduled” fence
    PVR driver “done” fence
    PVR Context
    PVR VM Context
    PVR VM Mappings
    PVR GEM Object

The reference that the PVR VM Context has on the VM mappings is a
soft one, in the sense that the freeing of outstanding VM mappings
is done as part of VM context destruction; no reference counts are
involved, as is the case for all the other references in the loop.

To break the reference loop during cleanup, free the outstanding
VM mappings before destroying the PVR Context associated with the
VM context.

Signed-off-by: Brendan King &lt;brendan.king@imgtec.com&gt;
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Reviewed-by: Frank Binns &lt;frank.binns@imgtec.com&gt;
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/8a25924f-1bb7-4d9a-a346-58e871dfb1d1@imgtec.com
</content>
</entry>
<entry>
<title>drm/imagination: Add a per-file PVR context list</title>
<updated>2024-11-04T09:41:32+00:00</updated>
<author>
<name>Brendan King</name>
<email>brendan.king@imgtec.com</email>
</author>
<published>2024-10-18T15:41:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b0ef514bc6bbdeb8cc7492c0f473e14cb06b14d4'/>
<id>urn:sha1:b0ef514bc6bbdeb8cc7492c0f473e14cb06b14d4</id>
<content type='text'>
This adds a linked list of VM contexts which is needed for the next patch
to be able to correctly track VM contexts for destruction on file close.

It is only safe for VM contexts to be removed from the list and destroyed
when not in interrupt context.

Signed-off-by: Brendan King &lt;brendan.king@imgtec.com&gt;
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
Reviewed-by: Frank Binns &lt;frank.binns@imgtec.com&gt;
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/e57128ea-f0ce-4e93-a9d4-3f033a8b06fa@imgtec.com
</content>
</entry>
<entry>
<title>Merge v6.11-rc7 into drm-next</title>
<updated>2024-09-11T07:18:15+00:00</updated>
<author>
<name>Simona Vetter</name>
<email>simona.vetter@ffwll.ch</email>
</author>
<published>2024-09-11T07:18:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b615b9c36cae0468491547206406a909a9a37f26'/>
<id>urn:sha1:b615b9c36cae0468491547206406a909a9a37f26</id>
<content type='text'>
Thomas needs 5a498d4d06d6 ("drm/fbdev-dma: Only install deferred I/O
if necessary") in drm-misc, so start the backmerge cascade.

Signed-off-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/imagination: Free pvr_vm_gpuva after unlink</title>
<updated>2024-09-02T08:48:48+00:00</updated>
<author>
<name>Matt Coster</name>
<email>matt.coster@imgtec.com</email>
</author>
<published>2024-09-02T08:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3f6b2f60b4631cd0c368da6a1587ab55a696164d'/>
<id>urn:sha1:3f6b2f60b4631cd0c368da6a1587ab55a696164d</id>
<content type='text'>
This caused a measurable memory leak. Although the individual
allocations are small, the leaks occurs in a high-usage codepath
(remapping or unmapping device memory) so they add up quickly.

Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code")
Cc: stable@vger.kernel.org
Reviewed-by: Frank Binns &lt;frank.binns@imgtec.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/35867394-d8ce-4698-a8fd-919a018f1583@imgtec.com
Signed-off-by: Matt Coster &lt;matt.coster@imgtec.com&gt;
</content>
</entry>
</feed>
