linux/drivers/gpu/drm
Keith Packard 170178fe99 drm: Update edid-derived drm_display_info fields at edid property set [v2]
There are a set of values in the drm_display_info structure for each
connector which hold information derived from EDID. These are computed
in drm_add_display_info. Before this patch, that was only called in
drm_add_edid_modes. This meant that they were only set when EDID was
present and never reset when EDID was not, as happened when the
display was disconnected.

One of these fields, non_desktop, is used from
drm_mode_connector_update_edid_property, the function responsible for
assigning the new edid value to the application-visible property.

Various drivers call these two functions (drm_add_edid_modes and
drm_mode_connector_update_edid_property) in different orders. This
means that even when EDID is present, the drm_display_info fields may
not have been computed at the time that
drm_mode_connector_update_edid_property used the non_desktop value to
set the non_desktop property.

I've added a public function (drm_reset_display_info) that resets the
drm_display_info field values to default values and then made the
drm_add_display_info function public. These two functions are now
called directly from drm_mode_connector_update_edid_property so that
the drm_display_info fields are always computed from the current EDID
information before being used in that function.

This means that the drm_display_info values are often computed twice,
once when the EDID property it set and a second time when EDID is used
to compute modes for the device. The alternative would be to uniformly
ensure that the values were computed once before being used, which
would require that all drivers reliably invoke the two paths in the
same order. The computation is inexpensive enough that it seems more
maintainable in the long term to simply compute them in both paths.

The API to drm_add_display_info has been changed so that it no longer
takes the set of edid-based quirks as a parameter. Rather, it now
computes those quirks itself and returns them for further use by
drm_add_edid_modes.

This patch also includes a number of 'const' additions caused by
drm_mode_connector_update_edid_property taking a 'const struct edid *'
parameter and wanting to pass that along to drm_add_display_info.

v2: after review by Daniel Vetter <daniel.vetter@ffwll.ch>

	Removed EXPORT_SYMBOL_GPL for drm_reset_display_info and
	drm_add_display_info.

	Added FIXME in drm_mode_connector_update_edid_property about
	potentially merging that with drm_add_edid_modes to avoid
	the need for two driver calls.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171213084427.31199-1-keithp@keithp.com
2017-12-13 14:29:18 +01:00
..
amd Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
arc drm/arc: Use drm_gem_cma_print_info() 2017-11-11 11:23:15 +01:00
arm drm/arm/mali: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:43 +01:00
armada drm/armada: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:03:52 +01:00
ast main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
atmel-hlcdc drm/atmel-hlcdc: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:39 +01:00
bochs main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
bridge Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
cirrus Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
etnaviv main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
exynos drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:04:53 +01:00
fsl-dcu drm/fsl-dcu: Use drm_mode_config_helper_suspend/resume() 2017-12-05 13:46:41 +01:00
gma500 drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:05:22 +01:00
hisilicon drm/hisilicon: Ensure LDI regs are properly configured. 2017-11-01 10:36:50 +08:00
i2c Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
i810
i915 drm/i915: Add "panel orientation" property to the panel connector, v6. 2017-12-04 23:03:21 +01:00
imx drm/imx: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:40 +01:00
lib License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mediatek Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
meson drm/meson: Add missing VPU init 2017-12-08 10:43:46 +01:00
mga
mgag200 main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
msm drm/msm: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:05:53 +01:00
mxsfb
nouveau drm/nouveau: Use drm_fb_helper_output_poll_changed() 2017-12-08 13:07:01 +01:00
omapdrm drm/omap: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:07:34 +01:00
panel Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
pl111 drm/pl111: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:41 +01:00
qxl Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
r128
radeon Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
rcar-du main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
rockchip drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:08:06 +01:00
savage
selftests Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
shmobile main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
sis
sti drm/sti: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:41 +01:00
stm drm/stm: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:41 +01:00
sun4i drm/sun4i: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:42 +01:00
tdfx
tegra drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed() 2017-12-08 13:09:27 +01:00
tilcdc drm/tilcdc: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:42 +01:00
tinydrm drm/tinydrm: Use drm_fb_cma_fbdev_init_with_funcs/fini() 2017-12-10 15:37:07 +01:00
ttm Merge branch 'drm-fixes-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-fixes 2017-12-01 09:15:57 +10:00
tve200 drm/tve200: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:42 +01:00
udl
vc4 drm/vc4: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:43 +01:00
vgem treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
via Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
virtio Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
vmwgfx Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
zte drm/zte: Use drm_fb_cma_fbdev_init/fini() 2017-12-08 14:47:43 +01:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
drm_atomic.c Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
drm_auth.c
drm_blend.c
drm_bridge.c
drm_bufs.c
drm_cache.c
drm_color_mgmt.c
drm_connector.c drm: Update edid-derived drm_display_info fields at edid property set [v2] 2017-12-13 14:29:18 +01:00
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c
drm_crtc_internal.h
drm_crtc.c
drm_debugfs_crc.c
drm_debugfs.c drm/debugfs: Fix framebuffer debugfs file init 2017-11-14 11:08:17 +02:00
drm_dma.c
drm_dp_aux_dev.c Pass mode to wait_on_atomic_t() action funcs and provide default actions 2017-11-13 15:38:16 +00:00
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm: don't link DP aux i2c adapter to the hardware device node 2017-11-20 09:34:17 +01:00
drm_dp_mst_topology.c
drm_drv.c Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c drm: Update edid-derived drm_display_info fields at edid property set [v2] 2017-12-13 14:29:18 +01:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c drm/cma-helper: Add drm_fb_cma_fbdev_init/fini() 2017-12-08 14:27:47 +01:00
drm_fb_helper.c drm/fb-helper: Fix potential NULL pointer dereference 2017-12-06 21:45:28 +01:00
drm_file.c
drm_flip_work.c
drm_fourcc.c
drm_framebuffer.c Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
drm_gem_cma_helper.c drm: gem_cma_helper.c: Allow importing of contiguous scatterlists with nents > 1 2017-11-15 18:14:46 +01:00
drm_gem_framebuffer_helper.c drm/gem-fb-helper: drm_gem_fbdev_fb_create() make funcs optional 2017-12-08 14:26:00 +01:00
drm_gem.c drm/framebuffer: Add framebuffer debugfs file 2017-11-11 11:21:19 +01:00
drm_global.c
drm_hashtab.c
drm_info.c
drm_internal.h Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
drm_ioc32.c
drm_ioctl.c
drm_irq.c
drm_kms_helper_common.c
drm_lease.c
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c
drm_mm.c drm: Spelling fixes 2017-11-02 11:10:37 -02:00
drm_mode_config.c drm: More debug info for fb leaks in mode_config_cleanup 2017-12-07 18:40:43 +01:00
drm_mode_object.c drm/mode_object: fix documentation for object lookups. 2017-11-10 13:50:47 +10:00
drm_modes.c
drm_modeset_helper.c drm/modeset-helper: Add simple modeset suspend/resume helpers 2017-11-30 18:18:08 +01:00
drm_modeset_lock.c drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all 2017-10-31 17:36:46 +01:00
drm_of.c
drm_panel_orientation_quirks.c drm: Add panel orientation quirks, v6. 2017-12-04 23:03:21 +01:00
drm_panel.c
drm_pci.c
drm_plane_helper.c drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c 2017-11-20 21:14:22 +02:00
drm_plane.c drm/vblank: Pass crtc_id to page_flip_ioctl. 2017-11-23 13:04:19 +01:00
drm_prime.c drm/prime: skip CPU sync in map/unmap dma_buf 2017-12-04 17:30:19 +01:00
drm_print.c drm/printer: Add drm_vprintf() 2017-11-23 12:31:49 +02:00
drm_probe_helper.c drm/probe-helper: Fix drm_kms_helper_poll_enable() docs 2017-11-30 18:17:37 +01:00
drm_property.c
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_simple_kms_helper.c drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c 2017-11-20 21:14:22 +02:00
drm_syncobj.c Merge airlied/drm-next into drm-misc-next 2017-11-21 14:17:56 +01:00
drm_sysfs.c
drm_trace_points.c
drm_trace.h main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
drm_vblank.c Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2017-12-04 05:42:49 +10:00
drm_vm.c
drm_vma_manager.c drm/drm_vma_manager.c: Remove useless goto statement 2017-11-02 10:44:08 +01:00
Kconfig drm: Document that drm_panel_orientation_quirks.c is shared with fbdev 2017-12-05 12:08:57 +01:00
Makefile drm: Add panel orientation quirks, v6. 2017-12-04 23:03:21 +01:00