<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/drm_framebuffer.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-07-17T16:37:12+00:00</updated>
<entry>
<title>drm/framebuffer: Acquire internal references on GEM handles</title>
<updated>2025-07-17T16:37:12+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2025-07-07T13:11:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=065bd940ee0a0033ea9a7dbb1a9110baef9415a4'/>
<id>urn:sha1:065bd940ee0a0033ea9a7dbb1a9110baef9415a4</id>
<content type='text'>
commit f6bfc9afc7510cb5e6fbe0a17c507917b0120280 upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm: Warn when freeing a framebuffer that's still on a list</title>
<updated>2023-12-23T05:31:29+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2023-12-11T08:16:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:43+00:00</updated>
<author>
<name>Tomi Valkeinen</name>
<email>tomi.valkeinen@ideasonboard.com</email>
</author>
<published>2023-11-03T13:14:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:56+00:00</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2023-10-20T10:19:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:37+00:00</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2023-10-20T10:19:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:29+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2023-09-26T14:15:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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>
<entry>
<title>drm/debugfs: rework debugfs directory creation v5</title>
<updated>2023-09-01T06:51:18+00:00</updated>
<author>
<name>Christian König</name>
<email>ckoenig.leichtzumerken@gmail.com</email>
</author>
<published>2023-08-29T11:01:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0b30d57acafcaa5374756d314ee54f80d0bcc860'/>
<id>urn:sha1:0b30d57acafcaa5374756d314ee54f80d0bcc860</id>
<content type='text'>
Instead of the per minor directories only create a single debugfs
directory for the whole device directly when the device is initialized.

For DRM devices each minor gets a symlink to the per device directory
for now until we can be sure that this isn't useful any more in any way.

Accel devices create only the per device directory and also drops the mid
layer callback to create driver specific files.

v2: cleanup accel component as well
v3: fix typo when debugfs is disabled
v4: call drm_debugfs_dev_fini() during release as well,
    some kerneldoc typos fixed
v5: rebased and one more kerneldoc fix

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230829110115.3442-4-christian.koenig@amd.com
Reviewed-by: Andi Shyti &lt;andi.shyti@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>drm: use new debugfs device-centered functions on DRM core files</title>
<updated>2022-12-22T17:58:21+00:00</updated>
<author>
<name>Maíra Canal</name>
<email>mcanal@igalia.com</email>
</author>
<published>2022-12-19T12:06:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6fd80729f14e3f70d4c07ea91ac44ed5ab8dfe60'/>
<id>urn:sha1:6fd80729f14e3f70d4c07ea91ac44ed5ab8dfe60</id>
<content type='text'>
Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_files() function in all DRM core files, centering the
debugfs files management on the drm_device instead of drm_minor.

Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Reviewed-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Reviewed-by: Melissa Wen &lt;mwen@igalia.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Maíra Canal &lt;mairacanal@riseup.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20221219120621.15086-3-mcanal@igalia.com
</content>
</entry>
<entry>
<title>drm/framebuffer: convert to drm_dbg_kms()</title>
<updated>2022-09-28T08:43:30+00:00</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2022-09-05T10:36:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=019d157e5b0355b4da957f262b3eeb3b7a948f8b'/>
<id>urn:sha1:019d157e5b0355b4da957f262b3eeb3b7a948f8b</id>
<content type='text'>
Replace DRM_DEBUG_KMS() with drm_dbg_kms() which allows specifying
the DRM device to provide more context.

Signed-off-by: Simon Ser &lt;contact@emersion.fr&gt;
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220905103559.118561-1-contact@emersion.fr
</content>
</entry>
<entry>
<title>drm:remove rebundant word "in" in comments</title>
<updated>2022-07-19T07:03:24+00:00</updated>
<author>
<name>shaomin Deng</name>
<email>dengshaomin@cdjrlc.com</email>
</author>
<published>2022-07-18T15:04:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3475b50873e4a68302822d91ab5cb031c1a92d50'/>
<id>urn:sha1:3475b50873e4a68302822d91ab5cb031c1a92d50</id>
<content type='text'>
there is a repeated word "in", so remove it.

Signed-off-by: shaomin Deng &lt;dengshaomin@cdjrlc.com&gt;
Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220718150418.7321-1-dengshaomin@cdjrlc.com
</content>
</entry>
</feed>
