linux-yocto/include/drm
Thomas Zimmermann 065bd940ee drm/framebuffer: Acquire internal references on GEM handles
commit f6bfc9afc7 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 5307dce878 ("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 <tzimmermann@suse.de>
Fixes: 5307dce878 ("drm/gem: Acquire references on GEM handles for framebuffers")
Reported-by: Bert Karwatzki <spasswolf@web.de>
Closes: https://lore.kernel.org/dri-devel/20250703115915.3096-1-spasswolf@web.de/
Tested-by: Bert Karwatzki <spasswolf@web.de>
Tested-by: Mario Limonciello <superm1@kernel.org>
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Anusha Srivatsa <asrivats@redhat.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: <stable@vger.kernel.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20250707131224.249496-1-tzimmermann@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-17 18:37:12 +02:00
..
bridge drm/bridge: analogix_dp: remove unused analogix_dp_remove 2024-06-27 11:52:04 +02:00
display drm/dp_mst: Fix drm RAD print 2025-04-10 14:39:13 +02:00
i2c drm/i2c: silence ch7006.h and sil164.h kernel-doc warnings 2024-03-11 14:29:19 +02:00
intel drm/xe/bmg: Add one additional PCI ID 2025-05-02 07:58:58 +02:00
ttm Linux 6.11-rc7 2024-09-11 09:18:15 +02:00
amd_asic_type.h drm/amdgpu: make amd_asic_type.h self-contained 2024-03-07 17:17:25 +02:00
drm_accel.h drm next for 6.12-rc1 2024-09-19 10:18:15 +02:00
drm_aperture.h
drm_atomic_helper.h
drm_atomic_state_helper.h
drm_atomic_uapi.h
drm_atomic.h drm/atomic: clarify the rules around drm_atomic_state->allow_modeset 2025-05-29 11:03:09 +02:00
drm_audio_component.h
drm_auth.h
drm_blend.h
drm_bridge_connector.h
drm_bridge.h drm/bridge-connector: implement glue code for HDMI connector 2024-06-12 10:56:57 +03:00
drm_buddy.h drm/buddy: Add start address support to trim function 2024-08-07 18:19:00 -04:00
drm_cache.h
drm_client_setup.h drm: Add client-agnostic setup helper 2025-03-13 13:02:02 +01:00
drm_client.h drm/fbdev-generic: Fix locking with drm_client_buffer_vmap_local() 2024-03-11 13:33:50 +01:00
drm_color_mgmt.h
drm_connector.h drm/connector: add mutex to protect ELD from concurrent access 2025-02-17 10:04:46 +01:00
drm_crtc_helper.h
drm_crtc.h
drm_damage_helper.h
drm_debugfs_crc.h drm/crc: make drm_debugfs_crc.h self-contained and fix kernel-doc 2024-03-07 17:17:25 +02:00
drm_debugfs.h
drm_device.h drm/vblank: add dynamic per-crtc vblank configuration support 2024-07-26 17:40:10 -04:00
drm_drv.h drm/fbdev: Add memory-agnostic fbdev client 2025-03-13 13:02:02 +01:00
drm_edid.h drm/edid: make drm_edid_block_valid() static 2024-08-14 12:16:34 +03:00
drm_eld.h
drm_encoder_slave.h drm/encoder: improve drm_encoder_slave.h kernel-doc 2024-03-11 11:47:06 +02:00
drm_encoder.h
drm_exec.h Merge drm/drm-next into drm-misc-next 2024-01-29 14:20:23 +01:00
drm_fb_dma_helper.h drm/fb_dma: s/drm_panic_gem_get_scanout_buffer/drm_fb_dma_get_scanout_buffer 2024-04-15 13:50:40 -03:00
drm_fb_helper.h drm/fbdev-helper: Remove drm_fb_helper_output_poll_changed() 2024-08-13 16:21:11 +02:00
drm_fbdev_client.h drm/fbdev: Add memory-agnostic fbdev client 2025-03-13 13:02:02 +01:00
drm_fbdev_dma.h drm/fbdev-dma: Support struct drm_driver.fbdev_probe 2025-05-22 14:29:53 +02:00
drm_fbdev_shmem.h drm/fbdev: Add fbdev-shmem 2024-05-02 11:33:15 +02:00
drm_fbdev_ttm.h drm/fbdev-ttm: Support struct drm_driver.fbdev_probe 2025-03-13 13:02:03 +01:00
drm_file.h drm/gem: Fix race in drm_gem_handle_create_tail() 2025-07-17 18:37:11 +02:00
drm_fixed.h drm: fixed: Don't use "proxy" headers 2024-08-13 12:13:45 +03:00
drm_flip_work.h
drm_format_helper.h drm: fix drm_format_helper.h kernel-doc warnings 2024-03-07 17:17:25 +02:00
drm_fourcc.h drm/fbdev-helper: Move color-mode lookup into 4CC format helper 2025-03-13 13:02:02 +01:00
drm_framebuffer.h drm/framebuffer: Acquire internal references on GEM handles 2025-07-17 18:37:12 +02:00
drm_gem_atomic_helper.h
drm_gem_dma_helper.h fs: move FMODE_UNSIGNED_OFFSET to fop_flags 2024-08-30 08:22:36 +02:00
drm_gem_framebuffer_helper.h
drm_gem_shmem_helper.h drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}() 2024-03-11 13:33:50 +01:00
drm_gem_ttm_helper.h
drm_gem_vram_helper.h Merge drm/drm-next into drm-misc-next 2024-04-02 09:51:30 +02:00
drm_gem.h drm/gem: Internally test import_attach for imported objects 2025-05-29 11:03:26 +02:00
drm_gpuvm.h Merge drm/drm-next into drm-misc-next 2024-01-29 14:20:23 +01:00
drm_ioctl.h
drm_kunit_helpers.h drm/tests: helpers: Create kunit helper to destroy a drm_display_mode 2025-04-20 10:15:07 +02:00
drm_lease.h drm/lease: make drm_lease.h self-contained 2024-03-07 17:17:25 +02:00
drm_managed.h drm/managed: Add drmm_release_action 2024-01-17 10:38:39 +01:00
drm_mipi_dbi.h drm/mipi-dbi: Add support for DRM_FORMAT_RGB888 2024-06-07 16:09:05 +02:00
drm_mipi_dsi.h drm/mipi-dsi: Add mipi_dsi_dcs_set_tear_scanline_multi 2024-08-20 14:17:54 -07:00
drm_mm.h drm/mm: Remove unused drm_mm_replace_node 2024-06-06 10:24:13 -04:00
drm_mode_config.h drm: Remove struct drm_mode_config_funcs.output_poll_changed 2024-08-13 16:21:13 +02:00
drm_mode_object.h
drm_modes.h drm: Move drm_set_preferred_mode() helper from drm_edid to drm_modes 2024-01-05 21:14:46 +01:00
drm_modeset_helper_vtables.h drm/panic: Add a drm panic handler 2024-04-15 16:12:49 +02:00
drm_modeset_helper.h
drm_modeset_lock.h
drm_module.h
drm_of.h drm/of: make drm_of.h self-contained 2024-03-07 17:17:25 +02:00
drm_panel.h
drm_panic.h drm/panic: Fix uninitialized spinlock acquisition with CONFIG_DRM_PANIC=n 2024-12-09 10:41:12 +01:00
drm_pciids.h
drm_plane_helper.h
drm_plane.h drm: Export drm_plane_has_format() 2024-06-24 17:08:53 +03:00
drm_prime.h drm: new helper: drm_gem_prime_handle_to_dmabuf() 2024-09-10 13:44:30 -04:00
drm_print.h drm/printer: Allow NULL data in devcoredump printer 2024-08-01 11:00:12 -07:00
drm_privacy_screen_consumer.h
drm_privacy_screen_driver.h
drm_privacy_screen_machine.h
drm_probe_helper.h drm/ast: Automatically clean up poll helper 2024-04-02 10:40:52 +02:00
drm_property.h
drm_rect.h drm/rect: Add drm_rect_overlap() 2024-08-23 16:47:56 +02:00
drm_self_refresh_helper.h
drm_simple_kms_helper.h
drm_suballoc.h drm/suballoc: fix drm_suballoc.h kernel-doc 2024-03-07 17:17:25 +02:00
drm_syncobj.h
drm_sysfs.h
drm_util.h
drm_utils.h drm: Add panel backlight quirks 2025-02-17 10:04:45 +01:00
drm_vblank_work.h drm: Add drm_vblank_work_flush_all(). 2024-06-24 18:03:18 +02:00
drm_vblank.h drm/vblank: add dynamic per-crtc vblank configuration support 2024-07-26 17:40:10 -04:00
drm_vma_manager.h
drm_writeback.h
gpu_scheduler.h Short summary of fixes pull: 2024-10-01 08:15:55 +10:00
gud.h
spsc_queue.h drm/sched: Increment job count before swapping tail spsc queue 2025-07-17 18:37:11 +02:00
task_barrier.h