linux-stable/drivers/gpu/drm
Douglas Anderson fae7d18640 drm/probe-helper: Default to 640x480 if no EDID on DP
If we're unable to read the EDID for a display because it's corrupt /
bogus / invalid then we'll add a set of standard modes for the
display. Since we have no true information about the connected
display, these modes are essentially guesses but better than nothing.
At the moment, none of the modes returned is marked as preferred, but
the modes are sorted such that the higher resolution modes are listed
first.

When userspace sees these modes presented by the kernel it needs to
figure out which one to pick. At least one userspace, ChromeOS [1]
seems to use the rules (which seem pretty reasonable):
1. Try to pick the first mode marked as preferred.
2. Try to pick the mode which matches the first detailed timing
   descriptor in the EDID.
3. If no modes were marked as preferred then pick the first mode.

Unfortunately, userspace's rules combined with what the kernel is
doing causes us to fail section 4.2.2.6 (EDID Corruption Detection) of
the DP 1.4a Link CTS. That test case says that, while it's OK to allow
some implementation-specific fall-back modes if the EDID is bad that
userspace should _default_ to 640x480.

Let's fix this by marking 640x480 as default for DP in the no-EDID
case.

NOTES:
- In the discussion around v3 of this patch [2] there was talk about
  solving this in userspace and I even implemented a patch that would
  have solved this for ChromeOS, but then the discussion turned back
  to solving this in the kernel.
- Also in the discussion of v3 [2] it was requested to limit this
  change to just DP since folks were worried that it would break some
  subtle corner case on VGA or HDMI.

[1] a051f741d0:ui/ozone/platform/drm/common/drm_util.cc;l=488
[2] https://lore.kernel.org/r/20220513130533.v3.1.I31ec454f8d4ffce51a7708a8092f8a6f9c929092@changeid

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220601112302.v4.1.I31ec454f8d4ffce51a7708a8092f8a6f9c929092@changeid
2022-06-06 13:09:44 -07:00
..
amd drm/amd/display: Move connector debugfs to drm 2022-05-23 11:27:44 +03:00
arm malidp: Fix NULL vs IS_ERR() checking 2022-04-28 16:08:19 +01:00
armada Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
aspeed drm/aspeed: Add AST2600 chip support 2022-03-03 09:08:35 +10:30
ast drm: simplify the return expression of ast_drm_resume() 2022-05-05 09:18:54 +02:00
atmel-hlcdc drm/atmel-hlcdc: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:46 +01:00
bridge drm: bridge: Add TI DLPC3433 DSI to DMD bridge 2022-06-03 16:23:31 +02:00
display drm/dp: Add callbacks to make using DP AUX bus properly easier 2022-06-02 15:14:16 -07:00
etnaviv drm/etnaviv: avoid cleaning up sched_job when submit succeeded 2022-05-04 14:09:34 +02:00
exynos drm: exynos: dsi: Use child panel or bridge find helpers 2022-05-04 17:07:14 +02:00
fsl-dcu drm/fsl-dcu: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:46 +01:00
gma500 drm/gma500: Read EDID from the correct i2c adapter 2022-06-02 10:06:51 +02:00
gud dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
hisilicon Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
hyperv drm/hyperv : Removing the restruction of VRAM allocation with PCI bar size 2022-05-30 15:25:36 -07:00
i2c
i810
i915 drm/i915/display/debug: Expose crtc current bpc via debugfs 2022-05-23 11:27:41 +03:00
imx drm-misc-next for 5.19: 2022-04-12 17:44:27 +10:00
ingenic drm/ingenic: Add dw-hdmi driver specialization for jz4780 2022-04-11 16:04:39 +01:00
kmb drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
lib drm/selftests: add drm buddy alloc range testcase 2022-02-23 10:44:43 +01:00
lima dma-buf: specify usage while adding fences to dma_resv obj v7 2022-04-07 12:53:53 +02:00
mcde Revert "drm: bridge: mcde_dsi: Switch to devm_drm_of_get_bridge" 2022-05-04 17:06:31 +02:00
mediatek Merge drm/drm-next into drm-misc-next 2022-04-05 11:06:58 +02:00
meson drm/meson: add YUV422 output support 2022-05-18 09:13:31 +02:00
mga
mgag200 drm/mgag200: Split up connector's mode_valid helper 2022-05-17 20:24:44 +02:00
msm Linux 5.18-rc5 2022-05-03 16:08:48 +10:00
mxsfb drm: mxsfb: Implement LCDIF scanout CRC32 support 2022-05-05 01:03:49 +02:00
nouveau drm/nouveau: fix another off-by-one in nvbios_addr 2022-06-02 18:40:03 -04:00
omapdrm Merge drm/drm-next into drm-misc-next 2022-04-05 11:06:58 +02:00
panel drm/panel: Fix build error when CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20=y && CONFIG_DRM_DISPLAY_HELPER=m 2022-05-24 12:32:53 -07:00
panfrost drm/panfrost: Add arm,mali-valhall-jm compatible 2022-05-26 09:53:40 -04:00
pl111
qxl drm/qxl: add drm_gem_plane_helper_prepare_fb 2022-05-05 12:30:10 +02:00
r128 drm/r128: Fix undefined behavior due to shift overflowing the constant 2022-05-21 18:02:47 +02:00
radeon Linux 5.18-rc5 2022-05-03 16:08:48 +10:00
rcar-du drm-misc-next for v5.18: 2022-03-04 13:41:57 +10:00
rockchip drm/rockchip: vop2: unlock on error path in vop2_crtc_atomic_enable() 2022-05-15 21:53:37 +02:00
savage
scheduler drm/scheduler: Don't kill jobs in interrupt context 2022-05-17 10:06:41 -04:00
selftests drm: Rename dp/ to display/ 2022-04-25 11:17:45 +02:00
shmobile drm/shmobile: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:47 +01:00
sis
solomon drm/ssd130x: Only define a SPI device ID table when built as a module 2022-06-02 00:35:32 +02:00
sprd Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
sti drm/sti: fix typos in comments 2022-04-07 11:31:52 +02:00
stm stm: ltdc: fix two incorrect NULL checks on list iterator 2022-04-07 10:26:59 +02:00
sun4i Merge drm/drm-next into drm-misc-next 2022-05-03 11:53:42 +02:00
tdfx
tegra drm/display: Move SCDC helpers into display-helper library 2022-04-25 11:19:37 +02:00
tidss drm/tidss: Soft Reset DISPC on startup 2022-04-19 15:09:45 +03:00
tilcdc drm/tilcdc: fix typos in comment 2022-04-25 10:18:52 +03:00
tiny drm/st7735r: Fix module autoloading for Okaya RH128128T 2022-05-23 13:24:04 +02:00
ttm drm/ttm: move default BO destructor into VMWGFX v2 2022-05-09 14:49:50 +02:00
tve200 drm/tve200: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:48 +01:00
udl drm/udl: Set VGA connector 2022-05-18 06:52:03 +02:00
v3d drm/v3d: Fix null pointer dereference of pointer perfmon 2022-04-26 11:55:28 -01:00
vboxvideo drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
vc4 Merge drm/drm-next into drm-misc-next 2022-05-03 11:53:42 +02:00
vgem dma-buf: specify usage while adding fences to dma_resv obj v7 2022-04-07 12:53:53 +02:00
via
virtio dma-buf: specify usage while adding fences to dma_resv obj v7 2022-04-07 12:53:53 +02:00
vkms drm/vkms: Update vkms_composer_worker documentation 2022-05-25 17:40:44 +02:00
vmwgfx drm/ttm: move default BO destructor into VMWGFX v2 2022-05-09 14:49:50 +02:00
xen xen: branch for v5.18-rc1 2022-03-28 14:32:39 -07:00
xlnx drm/display: Introduce a DRM display-helper module 2022-04-25 11:19:21 +02:00
drm_agpsupport.c
drm_aperture.c
drm_atomic.c drm/atomic: Add atomic_print_state to private objects 2022-03-31 10:19:45 +02:00
drm_atomic_helper.c drm: fix error found in some cases after the patch d1af5cd86997 2022-01-14 14:31:54 +01:00
drm_atomic_state_helper.c drm/object: Add default color encoding and range value at reset 2022-02-25 17:57:14 +01:00
drm_atomic_uapi.c drm: handle kernel fences in drm_gem_plane_helper_prepare_fb v2 2022-05-02 09:01:51 +02:00
drm_auth.c
drm_blend.c drm/blend: fix typo in the comment 2022-03-16 09:36:13 +01:00
drm_bridge.c drm/bridge: Add devm_drm_bridge_add() 2022-06-02 15:15:10 -07:00
drm_bridge_connector.c drm/bridge_connector: enable HPD by default if supported 2022-03-04 19:34:24 +00:00
drm_buddy.c drm: add a check to verify the size alignment 2022-04-11 15:35:47 +02:00
drm_bufs.c
drm_cache.c drm for 5.18-rc1 2022-03-24 16:19:43 -07:00
drm_client.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_client_modeset.c drm/client: Don't add new command-line mode 2022-05-16 13:43:24 +02:00
drm_color_mgmt.c drm: fix typo in comment 2022-05-04 14:09:34 +02:00
drm_connector.c drm/display: Move HDMI helpers into display-helper module 2022-04-25 11:19:36 +02:00
drm_context.c
drm_crtc.c
drm_crtc_helper.c drm: Use drm_mode_copy() 2022-04-12 09:27:20 +03:00
drm_crtc_helper_internal.h drm/dp: Move DP declarations into separate header file 2022-01-17 11:25:44 +01:00
drm_crtc_internal.h
drm_damage_helper.c
drm_debugfs.c drm/debug: Expose connector's max supported bpc via debugfs 2022-05-23 11:27:36 +03:00
drm_debugfs_crc.c
drm_displayid.c drm/displayid: convert to drm_edid 2022-05-13 18:55:13 +03:00
drm_dma.c
drm_drv.c
drm_dumb_buffers.c
drm_edid.c drm/edid: convert version_greater() to drm_edid 2022-05-13 18:55:17 +03:00
drm_edid_load.c
drm_encoder.c drm: use ENOMEM for drmm_kzalloc allocation failures 2022-05-25 17:39:49 +02:00
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c fbdev: Rename pagelist to pagereflist for deferred I/O 2022-05-03 16:04:22 +02:00
drm_file.c
drm_flip_work.c
drm_format_helper.c drm/format-helper: Share implementation among conversion helpers 2022-05-05 08:54:09 +02:00
drm_fourcc.c drm/fourcc: Add packed 10bit YUV 4:2:0 format 2021-12-16 11:23:22 +01:00
drm_framebuffer.c drm: introduce fb_modifiers_not_supported flag in mode_config 2022-01-31 21:45:23 +01:00
drm_gem.c dma-buf: add enum dma_resv_usage v4 2022-04-07 12:53:53 +02:00
drm_gem_atomic_helper.c drm/gem: Ignore color planes that are unused by framebuffer format 2022-05-19 19:25:02 +02:00
drm_gem_cma_helper.c Linux 5.17-rc6 2022-02-28 14:57:14 +10:00
drm_gem_framebuffer_helper.c drm/gem: Warn on trying to use a non-existing framebuffer plane 2022-05-19 19:25:23 +02:00
drm_gem_shmem_helper.c drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
drm_gem_ttm_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem_vram_helper.c drm/gem-vram: Ignore planes that are unused by framebuffer format 2022-05-19 19:25:19 +02:00
drm_hashtab.c
drm_internal.h dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_ioc32.c
drm_ioctl.c drm: introduce fb_modifiers_not_supported flag in mode_config 2022-01-31 21:45:23 +01:00
drm_irq.c
drm_kms_helper_common.c drm/dp: Move DisplayPort helpers into separate helper module 2022-01-17 11:25:44 +01:00
drm_lease.c
drm_legacy.h
drm_legacy_misc.c
drm_lock.c
drm_managed.c drm: Add DRM-managed mutex_init() 2022-05-05 09:04:10 +02:00
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: align max_chunk to 2 in spi_transfer 2022-05-30 13:41:09 +02:00
drm_mipi_dsi.c drm/display: Move DSC header and helpers into display-helper module 2022-04-25 11:19:36 +02:00
drm_mm.c lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() 2022-01-22 08:33:37 +02:00
drm_mode_config.c
drm_mode_object.c drm/object: Add drm_object_property_get_default_value() function 2022-02-25 17:55:42 +01:00
drm_modes.c drm: Always warn if user-defined modes are not supported 2022-05-16 13:42:49 +02:00
drm_modeset_helper.c
drm_modeset_lock.c lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() 2022-01-22 08:33:37 +02:00
drm_nomodeset.c
drm_of.c Revert "drm: of: Lookup if child node has panel or bridge" 2022-04-21 09:18:08 +02:00
drm_panel.c
drm_panel_orientation_quirks.c Merge drm/drm-next into drm-intel-next 2022-01-31 13:19:33 -05:00
drm_pci.c
drm_plane.c drm/plane: Move range check for format_count earlier 2022-04-28 16:13:04 +01:00
drm_plane_helper.c
drm_prime.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_print.c
drm_privacy_screen.c drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
drm_privacy_screen_x86.c drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
drm_probe_helper.c drm/probe-helper: Default to 640x480 if no EDID on DP 2022-06-06 13:09:44 -07:00
drm_property.c
drm_rect.c
drm_scatter.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_syncobj.c drm: use dma_fence_unwrap_merge() in drm_syncobj 2022-05-30 14:30:36 +02:00
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c drm: Use drm_mode_copy() 2022-04-12 09:27:20 +03:00
drm_vblank_work.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c
Kconfig drm/display: Move HDMI helpers into display-helper module 2022-04-25 11:19:36 +02:00
Makefile drm/display: Move SCDC helpers into display-helper library 2022-04-25 11:19:37 +02:00