linux/drivers/gpu/drm
Ivan Mironov 66a8d5bfb5 drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock
Strict requirement of pixclock to be zero breaks support of SDL 1.2
which contains hardcoded table of supported video modes with non-zero
pixclock values[1].

To better understand which pixclock values are considered valid and how
driver should handle these values, I briefly examined few existing fbdev
drivers and documentation in Documentation/fb/. And it looks like there
are no strict rules on that and actual behaviour varies:

	* some drivers treat (pixclock == 0) as "use defaults" (uvesafb.c);
	* some treat (pixclock == 0) as invalid value which leads to
	  -EINVAL (clps711x-fb.c);
	* some pass converted pixclock value to hardware (uvesafb.c);
	* some are trying to find nearest value from predefined table
          (vga16fb.c, video_gx.c).

Given this, I believe that it should be safe to just ignore this value if
changing is not supported. It seems that any portable fbdev application
which was not written only for one specific device working under one
specific kernel version should not rely on any particular behaviour of
pixclock anyway.

However, while enabling SDL1 applications to work out of the box when
there is no /etc/fb.modes with valid settings, this change affects the
video mode choosing logic in SDL. Depending on current screen
resolution, contents of /etc/fb.modes and resolution requested by
application, this may lead to user-visible difference (not always):
image will be displayed in a right way, but it will be aligned to the
left instead of center. There is no "right behaviour" here as well, as
emulated fbdev, opposing to old fbdev drivers, simply ignores any
requsts of video mode changes with resolutions smaller than current.

The easiest way to reproduce this problem is to install sdl-sopwith[2],
remove /etc/fb.modes file if it exists, and then try to run sopwith
from console without X. At least in Fedora 29, sopwith may be simply
installed from standard repositories.

[1] SDL 1.2.15 source code, src/video/fbcon/SDL_fbvideo.c, vesa_timings
[2] http://sdl-sopwith.sourceforge.net/

Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
Cc: stable@vger.kernel.org
Fixes: 79e539453b ("DRM: i915: add mode setting support")
Fixes: 771fe6b912 ("drm/radeon: introduce kernel modesetting for radeon hardware")
Fixes: 785b93ef8c ("drm/kms: move driver specific fb common code to helper functions (v2)")
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190108072353.28078-3-mironov.ivan@gmail.com
2019-01-10 08:25:36 +01:00
..
amd drm/amdgpu: Don't fail resume process if resuming atomic state fails 2019-01-08 17:58:26 -05:00
arc drm: replace "drm_dev_unref" function with "drm_dev_put" 2018-11-24 22:12:54 +01:00
arm drm: mali-dp: Enable Mali-DP tiled buffer formats 2018-11-02 09:57:27 +00:00
armada Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
ast drm pull request for 4.21-rc1 2018-12-25 11:48:26 -08:00
atmel-hlcdc drm/atmel-hlcdc: Use drm_fbdev_generic_setup() 2018-11-01 15:24:22 +01:00
bochs Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next 2018-11-19 11:07:52 +10:00
bridge drm/bridge: tc358767: use DP connector if no panel set 2019-01-09 10:49:31 +01:00
cirrus drm-misc-next for v4.21, part 2: 2018-11-22 12:54:38 +10:00
etnaviv Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
exynos drm/exynos: fimd: Make pixel blend mode configurable 2018-12-14 15:46:15 +09:00
fsl-dcu drm/fsl-dcu: Use drm_fbdev_generic_setup() 2018-11-01 15:23:58 +01:00
gma500 Merge drm/drm-next into drm-misc-next 2018-08-27 10:00:03 -04:00
hisilicon drm/ttm: initialize globals during device init (v2) 2018-11-05 14:21:21 -05:00
i2c Merge branch 'drm-tda9950-fixes' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-fixes 2018-10-04 10:32:14 +10:00
i810 drm/i810: off by one in i810_dma_vertex() 2018-07-03 15:00:42 +02:00
i915 drm i915 gvt, amdgpu, core fixes 2019-01-05 18:25:19 -08:00
imx drm/imx: ipuv3-plane: add IDMAC timeout warning 2018-11-05 14:56:04 +01:00
lib
mediatek drm/mediatek: Only try to attach bridge if there is one 2018-12-03 11:08:22 +08:00
meson drm pull request for 4.21-rc1 2018-12-25 11:48:26 -08:00
mga
mgag200 drm/ttm: initialize globals during device init (v2) 2018-11-05 14:21:21 -05:00
msm Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
mxsfb drm: replace "drm_dev_unref" function with "drm_dev_put" 2018-11-24 22:12:54 +01:00
nouveau fbdev changes for v4.21: 2019-01-05 18:15:37 -08:00
omapdrm drm/omap: fix incorrect union usage 2018-12-03 14:46:30 +02:00
panel drm/panel: simple: Add AUO G101EVN010 panel support 2018-12-03 17:04:48 +01:00
pl111 drm/pl111: add of_node_put() 2018-11-28 09:31:07 -08:00
qxl Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
r128
radeon mm/mmu_notifier: use structure for invalidate_range_start/end callback 2018-12-28 12:11:50 -08:00
rcar-du drm pull request for 4.21-rc1 2018-12-25 11:48:26 -08:00
rockchip drm pull request for 4.21-rc1 2018-12-25 11:48:26 -08:00
savage drm/savage: off by one in savage_bci_cmdbuf() 2018-07-04 14:27:01 +02:00
scheduler drm/scheduler: Add drm_sched_suspend/resume_timeout() 2018-12-05 17:56:16 -05:00
selftests drm/selftest: fix spelling mistake "dimention" -> "dimension" 2018-12-11 15:19:42 +01:00
shmobile drm: replace "drm_dev_unref" function with "drm_dev_put" 2018-11-24 22:12:54 +01:00
sis
sti drm/sti: remove set but not used variable 'priv' 2018-11-13 12:07:18 +01:00
stm drm/stm: Use drm_fbdev_generic_setup() 2018-10-25 17:00:28 +02:00
sun4i drm/sun4i: Add compatible for H6 display engine 2018-12-04 08:46:28 +01:00
tdfx
tegra drm/tegra: sor: Reset the SOR if possible 2018-12-06 18:58:32 +01:00
tilcdc drm/tilcdc: Use drm_fbdev_generic_setup() 2018-11-01 15:25:41 +01:00
tinydrm drm/tinydrm: Use kmemdup rather than duplicating its implementation in repaper_spi_transfer() 2018-12-04 15:57:42 +01:00
ttm drm/ttm: Use drm_debug_printer for all ttm_bo_mem_space_debug output 2018-12-21 15:27:58 -05:00
tve200 drm: replace "drm_dev_unref" function with "drm_dev_put" 2018-11-24 22:12:54 +01:00
udl DRM: UDL: get rid of useless vblank initialization 2018-10-23 15:59:01 +02:00
v3d Final changes to drm-misc-next for v4.21: 2018-12-07 11:23:05 +10:00
vc4 drm: revert "expand replace_fence to support timeline point v2" 2018-12-05 11:01:11 +01:00
vgem drm/vgem: Fix typo in driver feature flags 2018-11-05 15:31:51 +00:00
via
virtio Merge remote-tracking branch 'drm/drm-next' into drm-misc-next 2018-11-29 16:12:50 +01:00
vkms drm/vkms: Remove set but not used variable 'vkms_obj' 2018-12-04 11:47:27 +01:00
vmwgfx IOMMU Updates for Linux v4.21 2019-01-01 15:55:29 -08:00
xen drm/xen-front: Use Xen common shared buffer implementation 2018-12-18 12:16:13 -05:00
zte drm/zte: Use drm_atomic_helper_shutdown 2018-10-05 18:04:10 +02:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c Final changes to drm-misc-next for v4.21: 2018-12-07 11:23:05 +10:00
drm_atomic_state_helper.c drm: Put damage blob when destroy plane state 2018-12-24 11:53:50 +01:00
drm_atomic_uapi.c Merge tag 'vmwgfx-next-2018-12-05' of git://people.freedesktop.org/~thomash/linux into drm-next 2018-12-06 13:43:56 +10:00
drm_atomic.c drm: Add a new plane property to send damage during plane update 2018-12-05 10:00:35 +01:00
drm_auth.c drm: set is_master to 0 upon drm_new_set_master() failure 2018-11-26 16:14:27 -05:00
drm_blend.c drm: Clarify DRM_MODE_REFLECT_X/Y documentation 2018-09-11 11:21:30 +01:00
drm_bridge.c drm: bridge: document bridge attach/detach imbalance 2018-09-13 11:28:12 +02:00
drm_bufs.c drm/bufs: Fix Spectre v1 vulnerability 2018-10-17 09:17:33 +02:00
drm_cache.c
drm_client.c drm/gem: Add drm_gem_object_funcs 2018-11-20 14:56:18 +01:00
drm_color_mgmt.c drm: Add DRM_MODESET_LOCK_BEGIN/END helpers 2018-11-29 10:48:31 -05:00
drm_connector.c Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next 2018-12-06 13:29:09 +10:00
drm_context.c drm: Differentiate the lack of an interface from invalid parameter 2018-09-14 17:29:47 +01:00
drm_crtc_helper_internal.h
drm_crtc_helper.c drm: Remove transitional helpers 2018-10-05 18:04:10 +02:00
drm_crtc_internal.h drm: refuse ADDFB2 ioctl for broken bigendian drivers 2018-09-10 07:10:36 +02:00
drm_crtc.c Final changes to drm-misc-next for v4.21: 2018-12-07 11:23:05 +10:00
drm_damage_helper.c drm: fix null pointer dereference on null state pointer 2018-12-24 11:52:43 +01:00
drm_debugfs_crc.c Revert "drm: crc: Wait for a frame before returning from open()" 2018-08-22 09:50:16 -07:00
drm_debugfs.c drm: Merge drm_info.c into drm_debugfs.c 2018-11-22 09:52:27 +01:00
drm_dma.c
drm_dp_aux_dev.c
drm_dp_cec.c drm: Do not call drm_dp_cec_set_edid() while registering DP connectors 2018-10-11 10:52:35 +02:00
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/dsc: Modify DRM helper to return complete DSC color depth capabilities 2018-11-27 15:30:34 -08:00
drm_dp_mst_topology.c Revert "drm/dp_mst: Skip validating ports during destruction, just ref" 2018-11-28 16:22:17 -05:00
drm_drv.c drm-misc-next for v4.21: 2018-11-29 10:28:49 +10:00
drm_dsc.c drm/dsc: Add helpers for DSC picture parameter set infoframes 2018-11-27 18:35:17 -08:00
drm_dumb_buffers.c drm-misc-next for 4.19: 2018-06-28 13:29:07 +10:00
drm_edid_load.c
drm_edid.c drm, i915, amdgpu, bridge + core quirk 2018-11-02 10:58:20 -07:00
drm_encoder_slave.c
drm_encoder.c drm: Differentiate the lack of an interface from invalid parameter 2018-09-14 17:29:47 +01:00
drm_fb_cma_helper.c drm-misc-next for v4.21, part 1: 2018-11-19 10:40:33 +10:00
drm_fb_helper.c drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock 2019-01-10 08:25:36 +01:00
drm_file.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
drm_flip_work.c
drm_fourcc.c drm: Introduce new DRM_FORMAT_XYUV 2018-11-20 16:20:13 +02:00
drm_framebuffer.c drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled 2018-11-02 09:58:10 +00:00
drm_gem_cma_helper.c drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS 2018-11-20 14:57:25 +01:00
drm_gem_framebuffer_helper.c drm/fourcc: Add char_per_block, block_w and block_h in drm_format_info 2018-11-02 09:55:27 +00:00
drm_gem.c drm/gem: Add drm_gem_object_funcs 2018-11-20 14:56:18 +01:00
drm_hashtab.c
drm_internal.h drm pull request for 4.21-rc1 2018-12-25 11:48:26 -08:00
drm_ioc32.c
drm_ioctl.c drm/ioctl: Fix Spectre v1 vulnerabilities 2018-12-20 08:13:29 +01:00
drm_irq.c drm: Differentiate the lack of an interface from invalid parameter 2018-09-14 17:29:47 +01:00
drm_kms_helper_common.c
drm_lease.c drm pull request for 4.21-rc1 2018-12-25 11:48:26 -08:00
drm_legacy.h
drm_lock.c drm: Differentiate the lack of an interface from invalid parameter 2018-09-14 17:29:47 +01:00
drm_memory.c drm: Shift * to be adjacent to pointer name 2018-10-16 14:39:25 +02:00
drm_mipi_dsi.c drm: Add support for pps and compression mode command packet 2018-07-25 07:51:05 -04:00
drm_mm.c
drm_mode_config.c Merge tag 'vmwgfx-next-2018-12-05' of git://people.freedesktop.org/~thomash/linux into drm-next 2018-12-06 13:43:56 +10:00
drm_mode_object.c drm: Remove 80-column line in drm_mode_object.c 2018-11-01 18:54:05 +01:00
drm_modes.c drm: Convert to using %pOFn instead of device_node.name 2018-10-01 10:16:39 +02:00
drm_modeset_helper.c drm: Unexport primary plane helpers 2018-10-05 18:06:49 +02:00
drm_modeset_lock.c drm: Add DRM_MODESET_LOCK_BEGIN/END helpers 2018-11-29 10:48:31 -05:00
drm_of.c drm/doc: Include drm_of.c helpers 2018-07-13 18:40:28 +02:00
drm_panel_orientation_quirks.c drm: panel-orientation-quirks: Do rotation quirk for new GPD Win2 FW 2018-11-15 10:55:30 +01:00
drm_panel.c This is the 4.19-rc6 release 2018-10-04 11:03:34 +10:00
drm_pci.c drm/drm_pci.c: Use dma_zalloc_coherent 2018-10-23 15:59:01 +02:00
drm_plane_helper.c drm: Unexport drm_plane_helper_check_update 2018-10-05 22:45:19 +02:00
drm_plane.c drm: Add DRM_MODESET_LOCK_BEGIN/END helpers 2018-11-29 10:48:31 -05:00
drm_prime.c drm/prime: Fix drm_gem_prime_mmap() stack use 2018-11-22 15:44:05 +01:00
drm_print.c drm: Add puts callback for the coredump printer 2018-07-30 08:49:41 -04:00
drm_probe_helper.c drm: drop _mode_ from remaining connector functions 2018-07-13 18:40:27 +02:00
drm_property.c drm: Differentiate the lack of an interface from invalid parameter 2018-09-14 17:29:47 +01:00
drm_rect.c
drm_scatter.c drm: Differentiate the lack of an interface from invalid parameter 2018-09-14 17:29:47 +01:00
drm_scdc_helper.c
drm_simple_kms_helper.c drm/tinydrm: Advertise that we can do only DRM_FORMAT_MOD_LINEAR. 2018-10-30 13:01:50 -07:00
drm_syncobj.c drm: revert "expand replace_fence to support timeline point v2" 2018-12-05 11:01:11 +01:00
drm_sysfs.c drm/lease: Send a distinct uevent 2018-11-30 10:57:18 +01:00
drm_trace_points.c
drm_trace.h
drm_vblank.c drm: Differentiate the lack of an interface from invalid parameter 2018-09-14 17:29:47 +01:00
drm_vm.c
drm_vma_manager.c drm: Remove "protection" around drm_vma_offset_manager_destroy() 2018-09-04 19:00:32 +01:00
drm_writeback.c drm: writeback: Fix doc that says connector should be disconnected 2018-07-16 16:35:27 +01:00
Kconfig drm/fb_helper: Allow leaking fbdev smem_start 2018-10-03 21:08:21 +02:00
Makefile Merge tag 'vmwgfx-next-2018-12-05' of git://people.freedesktop.org/~thomash/linux into drm-next 2018-12-06 13:43:56 +10:00