linux/drivers/gpu/drm
Thomas Zimmermann dbbf933d36 drm/atomic-helper: Don't allocate new plane state in CRTC check
In drm_atomic_helper_check_crtc_state(), do not add a new plane state
to the global state if it does not exist already. Adding a new plane
state will result in overhead for the plane during the atomic-commit
step.

For the test in drm_atomic_helper_check_crtc_state() to succeed, it
is important that the CRTC has an enabled primary plane after the
commit. Simply testing the CRTC state's plane_mask for a primary plane
is sufficient.

Note that the helper still only tests for an attached primary plane.
Drivers have to ensure that the plane contains valid pixel information.

v5:
	* fix commit description (Javier)
v3:
	* test for a primary plane in plane_mask (Ville)
v2:
	* remove unnecessary test for plane->crtc (Ville)
	* inline drm_atomic_get_next_plane_state() (Ville)
	* acquire plane lock before accessing plane->state (Ville)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Fixes: d6b9af1097 ("drm/atomic-helper: Add helper drm_atomic_helper_check_crtc_state()")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jocelyn Falempe <jfalempe@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20221007124338.24152-2-tzimmermann@suse.de
2022-10-08 15:26:45 +02:00
..
amd drm/amdgpu: Fix VRAM eviction issue 2022-09-22 19:53:06 +02:00
arm drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
armada drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
aspeed drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
ast drm/ast: Add Atomic gamma lut support for aspeed 2022-10-05 17:52:26 +02:00
atmel-hlcdc drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
bridge drm/bridge: ps8640: Add software to support aux defer 2022-10-05 08:09:52 -07:00
display drm/dp: Don't rewrite link config when setting phy test pattern 2022-09-28 12:22:31 +03:00
etnaviv
exynos drm-misc-next for v6.1: 2022-09-06 10:56:04 +02:00
fsl-dcu drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
gma500 drm/gma500: Call acpi_video_register_backlight() 2022-09-18 21:03:21 +02:00
gud drm/format-helper: Rework XRGB8888-to-GRAY8 conversion 2022-08-10 09:18:49 +02:00
hisilicon drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
hyperv drm/format-helper: Merge drm_fb_memcpy() and drm_fb_memcpy_toio() 2022-08-10 09:15:51 +02:00
i2c sound updates for 6.0-rc1 2022-08-06 10:19:51 -07:00
i810
i915 Immutable backlight-detect-refactor branch between acpi, drm-* and pdx86 2022-09-14 12:27:10 +01:00
imx drm-misc-next for v6.1: 2022-09-06 10:56:04 +02:00
ingenic drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
kmb drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
lib
lima
logicvc drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
mcde drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
mediatek drm/mediatek: dp: change mtk_dp_driver to static 2022-09-19 12:33:54 +03:00
meson drm/meson: remove drm bridges at aggregate driver unbind time 2022-09-23 09:45:49 +00:00
mga
mgag200 drm/format-helper: Merge drm_fb_memcpy() and drm_fb_memcpy_toio() 2022-08-10 09:15:51 +02:00
msm Merge tag 'drm-misc-next-2022-09-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2022-09-11 22:03:07 +10:00
mxsfb drm/lcdif: switch to devm_drm_of_get_bridge 2022-08-22 16:53:31 +02:00
nouveau drm/plane-helper: Provide DRM_PLANE_NON_ATOMIC_FUNCS initializer macro 2022-09-20 09:42:31 +02:00
omapdrm drm/omap: dmm_tiler:Remove the print function dev_err() 2022-09-09 16:23:21 +03:00
panel drm/panel: ws2401: Silent no spi_device_id warning 2022-10-03 21:50:53 +02:00
panfrost Merge tag 'drm-misc-next-2022-09-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2022-09-11 22:03:07 +10:00
pl111 drm:pl111: Add of_node_put() when breaking out of for_each_available_child_of_node() 2022-08-11 18:13:31 +02:00
qxl drm/qxl: drop set_prod_notify parameter from qxl_ring_create 2022-09-23 13:16:37 +02:00
r128
radeon Immutable backlight-detect-refactor branch between acpi, drm-* and pdx86 2022-09-14 12:27:10 +01:00
rcar-du drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
rockchip drm/rockchip: remove vop_writel from vop1 driver 2022-09-15 15:35:43 +02:00
savage
scheduler drm/sched: add missing NULL check in drm_sched_get_cleanup_job v2 2022-10-05 12:38:00 +02:00
shmobile drm/plane: Remove drm_plane_init() 2022-09-20 09:37:12 +02:00
sis drm/sis: use idr_init_base() to initialize dev_priv->object_idr 2022-07-28 15:35:56 +01:00
solomon drm/ssd130x: Iterate over damage clips instead of using a merged rect 2022-10-06 00:27:09 +02:00
sprd drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
sti drm-misc-next for v6.1: 2022-09-06 10:56:04 +02:00
stm drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
sun4i Merge tag 'drm-misc-next-2022-09-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2022-09-11 22:03:07 +10:00
tdfx
tegra drm/fb: rename FB CMA helpers to FB DMA helpers 2022-08-03 18:30:55 +02:00
tests drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_gray8() 2022-09-27 19:41:52 +02:00
tidss drm/tidss: fix repeated words in comments 2022-09-09 16:23:26 +03:00
tilcdc drm/plane: Remove drm_plane_init() 2022-09-20 09:37:12 +02:00
tiny drm/simpledrm: Synchronize access to GEM BOs 2022-09-27 10:27:00 +02:00
ttm drm/ttm: add dma_resv_assert_held() calls to vmap/vunmap 2022-09-26 12:07:01 +02:00
tve200 drm/tve200: Fix smatch warning 2022-08-26 14:22:59 +02:00
udl drm/udl: Add constants for commands 2022-10-07 13:47:40 +02:00
v3d drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
vboxvideo drm/vboxvideo: fix repeated words in comments 2022-09-17 15:01:24 +02:00
vc4 Merge drm/drm-next into drm-misc-next 2022-09-14 12:22:18 +01:00
vgem
via drm/via: Add new condition to via_dma_cleanup() 2022-09-07 07:01:16 +02:00
virtio virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create() 2022-09-23 13:16:37 +02:00
vkms Merge drm/drm-next into drm-misc-next 2022-09-14 12:22:18 +01:00
vmwgfx drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl() 2022-09-21 12:15:15 -04:00
xen Linux 5.19-rc6 2022-07-13 10:54:56 +10:00
xlnx drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
drm_agpsupport.c
drm_aperture.c drm/aperture: Fix some kerneldoc comments 2022-09-12 09:34:07 +02:00
drm_atomic.c
drm_atomic_helper.c drm/atomic-helper: Don't allocate new plane state in CRTC check 2022-10-08 15:26:45 +02:00
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_auth.c drm: use idr_init_base() to initialize master->lessee_idr 2022-07-28 15:35:55 +01:00
drm_blend.c
drm_bridge.c
drm_bridge_connector.c
drm_buddy.c
drm_bufs.c
drm_cache.c
drm_client.c
drm_client_modeset.c
drm_color_mgmt.c drm: fix whitespace in drm_plane_create_color_properties() 2022-08-04 15:24:46 +02:00
drm_connector.c drm/connector: Introduce drmm_connector_init 2022-07-13 10:46:06 +02:00
drm_context.c
drm_crtc.c drm/crtc: Introduce drmm_crtc_init_with_planes 2022-07-13 10:46:05 +02:00
drm_crtc_helper.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
drm_crtc_helper_internal.h
drm_crtc_internal.h
drm_damage_helper.c drm: Use original src rect while initializing damage iterator 2022-09-13 14:38:33 +03:00
drm_debugfs.c
drm_debugfs_crc.c
drm_displayid.c
drm_dma.c
drm_drv.c
drm_dumb_buffers.c
drm_edid.c drm/edid: Make version checks less convoluted 2022-10-05 01:18:11 +03:00
drm_edid_load.c
drm_encoder.c drm/encoder: Introduce drmm_encoder_init 2022-07-13 10:46:05 +02:00
drm_encoder_slave.c
drm_fb_dma_helper.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
drm_fb_helper.c
drm_file.c drm-misc-next for v6.1: 2022-09-06 10:56:04 +02:00
drm_flip_work.c
drm_format_helper.c drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_xrgb2101010() 2022-09-27 19:41:51 +02:00
drm_fourcc.c
drm_framebuffer.c drm/framebuffer: convert to drm_dbg_kms() 2022-09-28 10:43:30 +02:00
drm_gem.c drm/gem: Properly annotate WW context on drm_gem_lock_reservations() error 2022-08-09 18:43:28 +02:00
drm_gem_atomic_helper.c
drm_gem_dma_helper.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm-misc-next for v6.1: 2022-09-06 10:56:04 +02:00
drm_gem_ttm_helper.c drm/ttm: fix locking in vmap/vunmap TTM GEM helpers 2022-07-18 09:18:53 +02:00
drm_gem_vram_helper.c
drm_hashtab.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c drm: Prevent drm_copy_field() to attempt copying a NULL pointer 2022-07-15 10:25:36 +02:00
drm_irq.c
drm_kms_helper_common.c
drm_lease.c
drm_legacy.h
drm_legacy_misc.c
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() 2022-09-12 09:14:26 +02:00
drm_mipi_dsi.c drm/mipi-dsi: Detach devices when removing the host 2022-07-13 10:46:05 +02:00
drm_mm.c
drm_mode_config.c drm: hide unregistered connectors from GETCONNECTOR IOCTL 2022-09-05 12:59:53 +02:00
drm_mode_object.c
drm_modes.c
drm_modeset_helper.c drm/plane-helper: Provide DRM_PLANE_NON_ATOMIC_FUNCS initializer macro 2022-09-20 09:42:31 +02:00
drm_modeset_lock.c
drm_nomodeset.c
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c drm: panel-orientation-quirks: Add quirk for Aya Neo Air 2022-09-17 19:58:32 +02:00
drm_pci.c
drm_plane.c drm/plane: Allocate planes with drm_universal_plane_alloc() 2022-09-20 09:41:06 +02:00
drm_plane_helper.c drm/plane-helper: Warn if atomic drivers call non-atomic helpers 2022-09-20 09:42:31 +02:00
drm_prime.c
drm_print.c
drm_privacy_screen.c
drm_privacy_screen_x86.c
drm_probe_helper.c drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() 2022-09-12 09:14:26 +02:00
drm_property.c
drm_rect.c
drm_scatter.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/atomic-helper: Remove _HELPER_ infix from DRM_PLANE_HELPER_NO_SCALING 2022-07-26 18:42:00 +02:00
drm_syncobj.c
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c
drm_vblank_work.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c
Kconfig Immutable backlight-detect-refactor branch between acpi, drm-* and pdx86 2022-09-14 12:27:10 +01:00
Makefile drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00