<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/drm_framebuffer.c, branch v6.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-07-09T12:03:28Z</updated>
<entry>
<title>drm/framebuffer: Acquire internal references on GEM handles</title>
<updated>2025-07-09T12:03:28Z</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2025-07-07T13:11:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f6bfc9afc7510cb5e6fbe0a17c507917b0120280'/>
<id>urn:sha1:f6bfc9afc7510cb5e6fbe0a17c507917b0120280</id>
<content type='text'>
Acquire GEM handles in drm_framebuffer_init() and release them in
the corresponding drm_framebuffer_cleanup(). Ties the handle's
lifetime to the framebuffer. Not all GEM buffer objects have GEM
handles. If not set, no refcounting takes place. This is the case
for some fbdev emulation. This is not a problem as these GEM objects
do not use dma-bufs and drivers will not release them while fbdev
emulation is running. Framebuffer flags keep a bit per color plane
of which the framebuffer holds a GEM handle reference.

As all drivers use drm_framebuffer_init(), they will now all hold
dma-buf references as fixed in commit 5307dce878d4 ("drm/gem: Acquire
references on GEM handles for framebuffers").

In the GEM framebuffer helpers, restore the original ref counting
on buffer objects. As the helpers for handle refcounting are now
no longer called from outside the DRM core, unexport the symbols.

v3:
- don't mix internal flags with mode flags (Christian)
v2:
- track framebuffer handle refs by flag
- drop gma500 cleanup (Christian)

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Fixes: 5307dce878d4 ("drm/gem: Acquire references on GEM handles for framebuffers")
Reported-by: Bert Karwatzki &lt;spasswolf@web.de&gt;
Closes: https://lore.kernel.org/dri-devel/20250703115915.3096-1-spasswolf@web.de/
Tested-by: Bert Karwatzki &lt;spasswolf@web.de&gt;
Tested-by: Mario Limonciello &lt;superm1@kernel.org&gt;
Tested-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Cc: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Anusha Srivatsa &lt;asrivats@redhat.com&gt;
Cc: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Maxime Ripard &lt;mripard@kernel.org&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: "Christian König" &lt;christian.koenig@amd.com&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://lore.kernel.org/r/20250707131224.249496-1-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>Merge tag 'mm-nonmm-stable-2024-11-24-02-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm</title>
<updated>2024-11-26T00:09:48Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-26T00:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5f4745a7f057b58c9728ee4e2c5d6d79f382fe7'/>
<id>urn:sha1:f5f4745a7f057b58c9728ee4e2c5d6d79f382fe7</id>
<content type='text'>
Pull non-MM updates from Andrew Morton:

 - The series "resource: A couple of cleanups" from Andy Shevchenko
   performs some cleanups in the resource management code

 - The series "Improve the copy of task comm" from Yafang Shao addresses
   possible race-induced overflows in the management of
   task_struct.comm[]

 - The series "Remove unnecessary header includes from
   {tools/}lib/list_sort.c" from Kuan-Wei Chiu adds some cleanups and a
   small fix to the list_sort library code and to its selftest

 - The series "Enhance min heap API with non-inline functions and
   optimizations" also from Kuan-Wei Chiu optimizes and cleans up the
   min_heap library code

 - The series "nilfs2: Finish folio conversion" from Ryusuke Konishi
   finishes off nilfs2's folioification

 - The series "add detect count for hung tasks" from Lance Yang adds
   more userspace visibility into the hung-task detector's activity

 - Apart from that, singelton patches in many places - please see the
   individual changelogs for details

* tag 'mm-nonmm-stable-2024-11-24-02-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (71 commits)
  gdb: lx-symbols: do not error out on monolithic build
  kernel/reboot: replace sprintf() with sysfs_emit()
  lib: util_macros_kunit: add kunit test for util_macros.h
  util_macros.h: fix/rework find_closest() macros
  Improve consistency of '#error' directive messages
  ocfs2: fix uninitialized value in ocfs2_file_read_iter()
  hung_task: add docs for hung_task_detect_count
  hung_task: add detect count for hung tasks
  dma-buf: use atomic64_inc_return() in dma_buf_getfile()
  fs/proc/kcore.c: fix coccinelle reported ERROR instances
  resource: avoid unnecessary resource tree walking in __region_intersects()
  ocfs2: remove unused errmsg function and table
  ocfs2: cluster: fix a typo
  lib/scatterlist: use sg_phys() helper
  checkpatch: always parse orig_commit in fixes tag
  nilfs2: convert metadata aops from writepage to writepages
  nilfs2: convert nilfs_recovery_copy_block() to take a folio
  nilfs2: convert nilfs_page_count_clean_buffers() to take a folio
  nilfs2: remove nilfs_writepage
  nilfs2: convert checkpoint file to be folio-based
  ...
</content>
</entry>
<entry>
<title>drm: replace strcpy() with strscpy()</title>
<updated>2024-11-06T01:12:30Z</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2024-10-07T14:49:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3240aadaccc15d781d1669965ccad230a8c4a175'/>
<id>urn:sha1:3240aadaccc15d781d1669965ccad230a8c4a175</id>
<content type='text'>
To prevent errors from occurring when the src string is longer than the
dst string in strcpy(), we should use strscpy() instead.  This approach
also facilitates future extensions to the task comm.

Link: https://lkml.kernel.org/r/20241007144911.27693-8-laoar.shao@gmail.com
Signed-off-by: Yafang Shao &lt;laoar.shao@gmail.com&gt;
Suggested-by: Justin Stitt &lt;justinstitt@google.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Reviewed-by: Justin Stitt &lt;justinstitt@google.com&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Maxime Ripard &lt;mripard@kernel.org&gt;
Cc: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: David Airlie &lt;airlied@gmail.com&gt;
Cc: Alejandro Colomar &lt;alx@kernel.org&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Alexei Starovoitov &lt;alexei.starovoitov@gmail.com&gt;
Cc: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Christian Brauner &lt;brauner@kernel.org&gt;
Cc: Eric Biederman &lt;ebiederm@xmission.com&gt;
Cc: Eric Paris &lt;eparis@redhat.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Matthew Wilcox &lt;willy@infradead.org&gt;
Cc: Matus Jokay &lt;matus.jokay@stuba.sk&gt;
Cc: Ondrej Mosnacek &lt;omosnace@redhat.com&gt;
Cc: Paul Moore &lt;paul@paul-moore.com&gt;
Cc: Quentin Monnet &lt;qmo@kernel.org&gt;
Cc: "Serge E. Hallyn" &lt;serge@hallyn.com&gt;
Cc: Simon Horman &lt;horms@kernel.org&gt;
Cc: Stephen Smalley &lt;stephen.smalley.work@gmail.com&gt;
Cc: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
Cc: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Add test for drm_framebuffer_init()</title>
<updated>2024-09-11T12:17:10Z</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2735d5e4060960c7bd06698b0a1990c7d42c762e'/>
<id>urn:sha1:2735d5e4060960c7bd06698b0a1990c7d42c762e</id>
<content type='text'>
Add three KUnit test cases for the drm_framebuffer_init function:

1. Test if expected values are being set after drm_framebuffer_init() call.
2. Try to init a framebuffer without setting its format.
3. Try calling drm_framebuffer_init() with mismatch of the drm_device
   passed at the first argument and the one pointed by fb-&gt;dev.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-9-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Add test for drm_framebuffer_check_src_coords()</title>
<updated>2024-09-11T12:17:08Z</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=49cdbcbad6142bd738d27cbd8dc063ac9a35a464'/>
<id>urn:sha1:49cdbcbad6142bd738d27cbd8dc063ac9a35a464</id>
<content type='text'>
Add a parametrized test for the drm_framebuffer_check_src_coords function.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-6-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm: Warn when freeing a framebuffer that's still on a list</title>
<updated>2023-12-23T05:31:29Z</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2023-12-11T08:16:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=971740a4c3ac2692a8adb958d5f810c47f07e9b5'/>
<id>urn:sha1:971740a4c3ac2692a8adb958d5f810c47f07e9b5</id>
<content type='text'>
Sprinkle some extra WARNs around so that we might catch
premature framebuffer destruction more readily.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231211081625.25704-2-ville.syrjala@linux.intel.com
Acked-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/framebuffer: Fix use of uninitialized variable</title>
<updated>2023-12-07T07:21:43Z</updated>
<author>
<name>Tomi Valkeinen</name>
<email>tomi.valkeinen@ideasonboard.com</email>
</author>
<published>2023-11-03T13:14:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f9af8f0c1dc567a5a6a6318ff324c45d80d4a60f'/>
<id>urn:sha1:f9af8f0c1dc567a5a6a6318ff324c45d80d4a60f</id>
<content type='text'>
smatch reports:

drivers/gpu/drm/drm_framebuffer.c:654 drm_mode_getfb2_ioctl() error: uninitialized symbol 'ret'.

'ret' is possibly not set when there are no errors, causing the error
above. I can't say if that ever happens in real-life, but in any case I
think it is good to initialize 'ret' to 0.

Reviewed-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231103-uninit-fixes-v2-2-c22b2444f5f5@ideasonboard.com
</content>
</entry>
<entry>
<title>drm: introduce CLOSEFB IOCTL</title>
<updated>2023-10-27T11:47:56Z</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2023-10-20T10:19:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d208d875667e2a29beeec5d475f4b6b164b632fa'/>
<id>urn:sha1:d208d875667e2a29beeec5d475f4b6b164b632fa</id>
<content type='text'>
This new IOCTL allows callers to close a framebuffer without
disabling planes or CRTCs. This takes inspiration from Rob Clark's
unref_fb IOCTL [1] and DRM_MODE_FB_PERSIST [2].

User-space patch for wlroots available at [3]. IGT test available
at [4].

v2: add an extra pad field just in case we want to extend this IOCTL
in the future (Pekka, Sima).

[1]: https://lore.kernel.org/dri-devel/20170509153654.23464-1-robdclark@gmail.com/
[2]: https://lore.kernel.org/dri-devel/20211006151921.312714-1-contact@emersion.fr/
[3]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4394
[4]: https://lists.freedesktop.org/archives/igt-dev/2023-October/063294.html

Signed-off-by: Simon Ser &lt;contact@emersion.fr&gt;
Reviewed-by: Daniel Stone &lt;daniels@collabora.com&gt;
Acked-by: Pekka Paalanen &lt;pekka.paalanen@collabora.com&gt;
Cc: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: Dennis Filder &lt;d.filder@web.de&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231020101926.145327-2-contact@emersion.fr
</content>
</entry>
<entry>
<title>drm: extract closefb logic in separate function</title>
<updated>2023-10-27T11:47:37Z</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2023-10-20T10:19:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0226ba393eb1a90d63955cc407340c5d506ecacf'/>
<id>urn:sha1:0226ba393eb1a90d63955cc407340c5d506ecacf</id>
<content type='text'>
drm_mode_rmfb performs two operations: drop the FB from the
file_priv-&gt;fbs list, and make sure the FB is no longer used on a
plane.

In the next commit an IOCTL which only does so former will be
introduced, so let's split it into a separate function.

No functional change, only refactoring.

v2: no change

Signed-off-by: Simon Ser &lt;contact@emersion.fr&gt;
Cc: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: Dennis Filder &lt;d.filder@web.de&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Pekka Paalanen &lt;ppaalanen@gmail.com&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Reviewed-by: Daniel Stone &lt;daniels@collabora.com&gt;
Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231020101926.145327-1-contact@emersion.fr
</content>
</entry>
<entry>
<title>drm: Replace drm_framebuffer plane size functions with its equivalents</title>
<updated>2023-10-12T07:51:29Z</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2023-09-26T14:15:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=451921e7bbc74fd87bfc9b413e4d57cc498fcca8'/>
<id>urn:sha1:451921e7bbc74fd87bfc9b413e4d57cc498fcca8</id>
<content type='text'>
The functions drm_framebuffer_plane_{width,height} and
fb_plane_{width,height} do exactly the same job of its
equivalents drm_format_info_plane_{width,height} from drm_fourcc.

The only reason to have these functions on drm_framebuffer
would be if they would added a abstraction layer to call it just
passing a drm_framebuffer pointer and the desired plane index,
which is not the case, where these functions actually implements
just part of it. In the actual implementation, every call to both
drm_framebuffer_plane_{width,height} and fb_plane_{width,height} should
pass some drm_framebuffer attribute, which is the same as calling the
drm_format_info_plane_{width,height} functions.

The drm_format_info_pane_{width,height} functions are much more
consistent in both its implementation and its location on code. The
kind of calculation that they do is intrinsically derivated from the
drm_format_info struct and has not to do with drm_framebuffer, except
by the potential motivation described above, which is still not a good
justification to have drm_framebuffer functions to calculate it.

So, replace each drm_framebuffer_plane_{width,height} and
fb_plane_{width,height} call to drm_format_info_plane_{width,height}
and remove them.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Reviewed-by: André Almeida &lt;andrealmeid@igalia.com&gt;
Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230926141519.9315-3-gcarlos@disroot.org
</content>
</entry>
</feed>
