mirror_ubuntu-kernels/drivers/gpu/drm
Jani Nikula c533b5167c drm/edid: add separate drm_edid_connector_add_modes()
The original goal with drm_edid_connector_update() was to have a single
call for updating the connector and adding probed modes, in this order,
but that turned out to be problematic. Drivers that need to update the
connector in the .detect() callback would end up updating the probed
modes as well. Turns out the callback may be called so many times that
the probed mode list fills up without bounds, and this is amplified by
add_alternate_cea_modes() duplicating the CEA modes on every call,
actually running out of memory on some machines.

Kudos to Imre Deak <imre.deak@intel.com> for explaining this to me.

Go back to having separate drm_edid_connector_update() and
drm_edid_connector_add_modes() calls. The former may be called from
.detect(), .force(), or .get_modes(), but the latter only from
.get_modes().

Unlike drm_add_edid_modes(), have drm_edid_connector_add_modes() update
the probed modes from the EDID property instead of the passed in
EDID. This is mainly to enforce two things:

1) drm_edid_connector_update() must be called before
   drm_edid_connector_add_modes().

   Display info and quirks are needed for parsing the modes, and we
   don't want to call update_display_info() again to ensure the info is
   available, like drm_add_edid_modes() does.

2) The same EDID is used for both updating the connector and adding the
   probed modes.

Fortunately, the change is easy, because no driver has actually adopted
drm_edid_connector_update(). Not even i915, and that's mainly because of
the problem described above.

Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e86fff1579f14ebf6334692526c8f6831cd02cac.1674144945.git.jani.nikula@intel.com
2023-01-23 11:46:47 +02:00
..
amd Merge drm/drm-next into drm-misc-next 2023-01-19 10:56:12 +01:00
arm drm/arm/komeda: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:30 +01:00
armada drm/fb-helper: Perform all fbdev I/O with the same implementation 2022-11-05 17:05:54 +01:00
aspeed drm/aspeed: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
ast drm/ast: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
atmel-hlcdc drm: atmel-hlcdc: Remove #ifdef guards for PM related functions 2022-12-12 12:30:56 +00:00
bridge drm/bridge: fsl-ldb: Add i.MX93 LDB support 2023-01-23 09:46:38 +01:00
display drm/display/dp_mst: Fix payload addition on a disconnected sink 2022-12-16 16:55:29 +02:00
etnaviv MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
exynos drm: exynos: dsi: Properly name HSA/HBP/HFP/HSE bits 2023-01-20 16:04:35 +01:00
fsl-dcu hardening updates for v6.2-rc1 2022-12-14 12:20:00 -08:00
gma500 drm/gma500: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
gud drm/gud: use new debugfs device-centered functions 2023-01-06 16:15:08 -03:00
hisilicon drm: Only select I2C_ALGOBIT for drivers that actually need it 2023-01-10 11:15:44 +01:00
hyperv drm/fb-helper: Remove unnecessary include statements 2022-11-05 17:12:04 +01:00
i2c Merge drm/drm-next into drm-misc-next 2023-01-19 10:56:12 +01:00
i915 Merge drm/drm-next into drm-misc-next 2023-01-19 10:56:12 +01:00
imx drm/imx/dcss: Don't call dev_set_drvdata(..., NULL); 2023-01-10 16:26:06 +02:00
ingenic drm/ingenic: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
kmb drm/kmb: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
lib
lima Linux 6.1-rc6 2022-11-24 11:05:43 +10:00
logicvc drm/logicvc: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
mcde drm/fb-helper: Move generic fbdev emulation into separate source file 2022-11-05 17:12:04 +01:00
mediatek drm-misc-next for v6.3: 2023-01-04 14:59:25 +01:00
meson drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion 2023-01-10 09:30:37 +01:00
mgag200 drm: Only select I2C_ALGOBIT for drivers that actually need it 2023-01-10 11:15:44 +01:00
msm drm-misc-next for v6.3: 2023-01-16 15:33:28 +10:00
mxsfb drm/mxsfb: improve clk handling for axi clk 2023-01-10 11:04:56 +01:00
nouveau drm/nouveau: stop using ttm_bo_wait 2023-01-18 15:57:52 +01:00
omapdrm drm/omap: Fix kernel docs 2023-01-17 17:57:33 +02:00
panel drm/panel: Add driver for the AUO A030JTN01 TFT LCD 2023-01-22 11:25:06 +00:00
panfrost drm: panfrost: Remove #ifdef guards for PM related functions 2022-12-12 13:07:01 +00:00
pl111 drm/fb-helper: Move generic fbdev emulation into separate source file 2022-11-05 17:12:04 +01:00
qxl drm/qxl: stop using ttm_bo_wait 2022-12-19 09:50:06 +01:00
radeon Merge drm/drm-next into drm-misc-next 2023-01-19 10:56:12 +01:00
rcar-du drm-misc-next for v6.3: 2023-01-04 14:59:25 +01:00
rockchip drm/rockchip: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
scheduler drm/scheduler: deprecate drm_sched_resubmit_jobs 2023-01-18 12:46:52 +01:00
shmobile drm/shmobile: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
solomon drm/solomon: Set preferred color depth and bpp to the correct values 2022-11-24 14:07:52 +01:00
sprd drm/sprd: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
sti hardening updates for v6.2-rc1 2022-12-14 12:20:00 -08:00
stm drm/fb-helper: Move generic fbdev emulation into separate source file 2022-11-05 17:12:04 +01:00
sun4i drm/sun4i: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
tegra drm/tegra: Changes for v6.2-rc1 2022-11-30 13:08:58 +10:00
tests drm-misc-next for v6.3: 2023-01-16 15:33:28 +10:00
tidss drm/tidss: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
tilcdc drm: tilcdc: Remove #ifdef guards for PM related functions 2022-12-12 13:07:02 +00:00
tiny drm/fb-helper: Replace bpp/depth parameter by color mode 2023-01-06 14:21:56 +01:00
ttm drm/ttm/vmwgfx: move ttm_bo_wait into VMWGFX 2023-01-18 15:57:52 +01:00
tve200 drm/fb-helper: Move generic fbdev emulation into separate source file 2022-11-05 17:12:04 +01:00
udl drm/udl: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
v3d drm/v3d: replace open-coded implementation of drm_gem_object_lookup 2023-01-03 18:16:01 -01:00
vboxvideo drm/vboxvideo: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
vc4 vc4: fix build failure in vc4_dsi_dev_probe() 2023-01-19 09:16:04 +01:00
vgem
virtio drm/virtio: Spiff out cmd queue/response traces 2023-01-02 17:51:27 +03:00
vkms drm/vkms: reintroduce prepare_fb and cleanup_fb functions 2023-01-12 09:46:19 -01:00
vmwgfx Merge drm/drm-next into drm-misc-next 2023-01-19 10:56:12 +01:00
xen drm/fb-helper: Remove unnecessary include statements 2022-11-05 17:12:04 +01:00
xlnx drm-misc-next for 6.2: 2022-11-16 07:17:32 +10:00
drm_agpsupport.c
drm_aperture.c
drm_atomic_helper.c drm/atomic-helper: Add {begin,end}_fb_access to plane helpers 2022-11-08 17:10:27 +01:00
drm_atomic_state_helper.c drm/atomic-helper: fix kernel-doc problems 2023-01-19 09:16:04 +01:00
drm_atomic_uapi.c drm/connector: Add TV standard property 2022-11-24 12:42:39 +01:00
drm_atomic.c drm: use new debugfs device-centered functions on DRM core files 2022-12-22 14:58:21 -03:00
drm_auth.c
drm_blend.c drm/drm_blend: Remove usage of deprecated DRM_DEBUG_ATOMIC 2023-01-10 16:14:13 +01:00
drm_bridge_connector.c drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd() 2023-01-05 15:08:10 +01:00
drm_bridge.c drm/bridge: Document the expected behaviour of DSI host controllers 2022-12-08 09:56:57 +01:00
drm_buddy.c
drm_bufs.c drm/nouveau: Remove support for legacy contexts/buffers 2023-01-13 09:22:02 +01:00
drm_cache.c
drm_client_modeset.c drm/client: Remove match on mode name 2022-11-24 12:42:40 +01:00
drm_client.c drm: use new debugfs device-centered functions on DRM core files 2022-12-22 14:58:21 -03:00
drm_color_mgmt.c
drm_connector.c drm/edid: parse VICs from CTA VDB early 2023-01-19 10:53:24 +02:00
drm_context.c drm/nouveau: Remove support for legacy contexts/buffers 2023-01-13 09:22:02 +01:00
drm_crtc_helper_internal.h
drm_crtc_helper.c drm/fb-helper: Remove unnecessary include statements 2022-11-05 17:12:04 +01:00
drm_crtc_internal.h drm/edid: move edid load declarations to internal header 2022-10-26 09:53:56 +03:00
drm_crtc.c
drm_damage_helper.c
drm_debugfs_crc.c
drm_debugfs.c drm/debugfs: use octal permissions instead of symbolic permissions 2023-01-10 09:57:05 -03:00
drm_displayid.c
drm_dma.c
drm_drv.c drm-misc-next for v6.3: 2023-01-04 14:59:25 +01:00
drm_dumb_buffers.c
drm_edid_load.c drm/edid/firmware: stop using a throwaway platform device 2022-11-16 14:54:44 +02:00
drm_edid.c drm/edid: add separate drm_edid_connector_add_modes() 2023-01-23 11:46:47 +02:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_dma_helper.c
drm_fb_helper.c drm/fb-helper: Do not allocate unused apertures structure 2023-01-13 12:54:24 +01:00
drm_fbdev_generic.c drm/fb-helper: Don't use the preferred depth for the BPP default 2022-11-24 14:07:52 +01:00
drm_file.c drm-misc-next for v6.3: 2023-01-16 15:33:28 +10:00
drm_flip_work.c
drm_format_helper.c drm/format-helper: Remove unnecessary conversion helpers 2023-01-03 14:28:02 +01:00
drm_fourcc.c drm/fourcc: Add missing big-endian XRGB1555 and RGB565 formats 2022-11-23 20:34:46 +01:00
drm_framebuffer.c drm: use new debugfs device-centered functions on DRM core files 2022-12-22 14:58:21 -03:00
drm_gem_atomic_helper.c drm/simple-kms: Remove drm_gem_simple_display_pipe_prepare_fb() 2022-12-05 13:35:37 +01:00
drm_gem_dma_helper.c drm: Remove usage of deprecated DRM_DEBUG_PRIME 2023-01-10 16:14:13 +01:00
drm_gem_framebuffer_helper.c drm/fb-helper: Remove unnecessary include statements 2022-11-05 17:12:04 +01:00
drm_gem_shmem_helper.c drm-misc-next for v6.3: 2023-01-16 15:33:28 +10:00
drm_gem_ttm_helper.c drm/ttm: merge ttm_bo_api.h and ttm_bo_driver.h v2 2022-12-06 12:54:14 +01:00
drm_gem_vram_helper.c drm: use new debugfs device-centered functions on DRM core files 2022-12-22 14:58:21 -03:00
drm_gem.c drm/gem-shmem: When drm_gem_object_init failed, should release object 2022-11-21 16:55:52 +01:00
drm_hashtab.c
drm_internal.h drm/debugfs: create debugfs late register functions 2022-12-22 14:58:55 -03:00
drm_ioc32.c drm: Replace DRM_DEBUG with drm_dbg_core in file and ioctl handling 2023-01-03 18:20:57 +01:00
drm_ioctl.c drm: Replace DRM_DEBUG with drm_dbg_core in file and ioctl handling 2023-01-03 18:20:57 +01:00
drm_irq.c
drm_kms_helper_common.c
drm_lease.c drm: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:30 +01:00
drm_legacy_misc.c
drm_legacy.h
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: Support separate I/O regulator 2022-12-14 14:57:09 +01:00
drm_mipi_dsi.c drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightness 2023-01-19 08:21:56 +01:00
drm_mm.c
drm_mode_config.c drm/debugfs: create debugfs late register functions 2022-12-22 14:58:55 -03:00
drm_mode_object.c
drm_modes.c drm: Include <linux/of.h> where needed 2023-01-13 13:18:35 +01:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel_orientation_quirks.c drm: panel-orientation-quirks: Add quirk for DynaBook K50 2022-12-07 17:39:23 +01:00
drm_panel.c
drm_pci.c
drm_plane_helper.c drm: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:30 +01:00
drm_plane.c drm/docs: Explicitly document default CRTC background behavior 2023-01-04 16:12:15 +00:00
drm_prime.c drm: Assert held reservation lock for dma-buf mmapping 2022-11-11 23:49:47 +03:00
drm_print.c drm_print: add _ddebug descriptor to drm_*dbg prototypes 2022-09-24 15:02:02 +02:00
drm_privacy_screen_x86.c
drm_privacy_screen.c
drm_probe_helper.c drm/edid: add separate drm_edid_connector_add_modes() 2023-01-23 11:46:47 +02:00
drm_property.c
drm_rect.c gpu/drm: fix repeated words in comments 2022-10-24 09:27:04 +02:00
drm_scatter.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/simple-kms: Remove drm_gem_simple_display_pipe_prepare_fb() 2022-12-05 13:35:37 +01:00
drm_syncobj.c
drm_sysfs.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
drm_trace_points.c
drm_trace.h
drm_vblank_work.c
drm_vblank.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c
Kconfig drm: Add comments to Kconfig 2023-01-13 09:44:53 +01:00
Makefile Merge drm/drm-next into drm-misc-next 2023-01-19 10:56:12 +01:00