]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/gem-shmem: Track folio accessed/dirty status in vmap
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 27 Feb 2026 11:42:11 +0000 (12:42 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 11 Mar 2026 08:33:43 +0000 (09:33 +0100)
commit648fa9ca27e75e08a37047fb65ec179d349d1b1d
tree6850ca2ef57608291ada84399f964c867996f6c6
parent28e3918179aa75cfd4490b3b0281496ed91d829a
drm/gem-shmem: Track folio accessed/dirty status in vmap

On successful vmap, set the page_mark_accessed_on_put and _dirty_on_put
flags in the gem-shmem object. Signals that the contained pages require
LRU and dirty tracking when they are being released back to SHMEM. Clear
these flags on put, so that the buffer remains quiet until the next call
to vmap. There's no means of handling dirty status in vmap as there's no
write-only mapping available.

Both flags, _accessed_on_put and _dirty_on_put, have always been part of
the gem-shmem object, but never used much. So most drivers did not track
the page status correctly.

Only the v3d and imagination drivers make limited use of _dirty_on_put. In
the case of imagination, move the flag setting from init to cleanup. This
ensures writeback of modified pages but does not interfere with the
internal vmap/vunmap calls. V3d already implements this behaviour.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> # gem-shmem
Acked-by: Frank Binns <frank.binns@imgtec.com> # imagination
Tested-by: Frank Binns <frank.binns@imgtec.com> # imagination
Link: https://patch.msgid.link/20260227114509.165572-7-tzimmermann@suse.de
drivers/gpu/drm/drm_gem_shmem_helper.c
drivers/gpu/drm/imagination/pvr_gem.c