Home Home > GIT Browse > SLE12-SP3-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2019-01-16 09:32:37 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2019-01-16 09:59:21 +0100
commit89af5e6a2420df6db72292717a9d44a667a1ab2c (patch)
treeefc64719a5cb1ccc84d39a7e6430b7796a3c4744
parentc5890e62790abce676538a0759234cc0382e8c84 (diff)
drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock (bsc#1106929)
-rw-r--r--patches.fixes/0001-drm-fb-helper-Ignore-the-value-of-fb_var_screeninfo..patch78
-rw-r--r--series.conf1
2 files changed, 79 insertions, 0 deletions
diff --git a/patches.fixes/0001-drm-fb-helper-Ignore-the-value-of-fb_var_screeninfo..patch b/patches.fixes/0001-drm-fb-helper-Ignore-the-value-of-fb_var_screeninfo..patch
new file mode 100644
index 0000000000..36af2ad489
--- /dev/null
+++ b/patches.fixes/0001-drm-fb-helper-Ignore-the-value-of-fb_var_screeninfo..patch
@@ -0,0 +1,78 @@
+From 66a8d5bfb518f9f12d47e1d2dce1732279f9451e Mon Sep 17 00:00:00 2001
+From: Ivan Mironov <mironov.ivan@gmail.com>
+Date: Tue, 8 Jan 2019 12:23:53 +0500
+Subject: drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock
+Git-commit: 66a8d5bfb518f9f12d47e1d2dce1732279f9451e
+Patch-mainline: v5.0-rc2
+References: bsc#1106929
+
+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: 79e539453b34e ("DRM: i915: add mode setting support")
+Fixes: 771fe6b912fca ("drm/radeon: introduce kernel modesetting for radeon hardware")
+Fixes: 785b93ef8c309 ("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
+Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
+---
+ drivers/gpu/drm/drm_fb_helper.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/drm_fb_helper.c
++++ b/drivers/gpu/drm/drm_fb_helper.c
+@@ -1109,9 +1109,14 @@ int drm_fb_helper_check_var(struct fb_va
+ struct drm_framebuffer *fb = fb_helper->fb;
+ int depth;
+
+- if (var->pixclock != 0 || in_dbg_master())
++ if (in_dbg_master())
+ return -EINVAL;
+
++ if (var->pixclock != 0) {
++ DRM_DEBUG("fbdev emulation doesn't support changing the pixel clock, value of pixclock is ignored\n");
++ var->pixclock = 0;
++ }
++
+ /* Need to resize the fb object !!! */
+ if (var->bits_per_pixel > fb->bits_per_pixel ||
+ var->xres > fb->width || var->yres > fb->height ||
diff --git a/series.conf b/series.conf
index cf47cbe638..a38982ed34 100644
--- a/series.conf
+++ b/series.conf
@@ -23856,6 +23856,7 @@
patches.drivers/iommu-amd-fix-amd_iommu-force_isolation
patches.fixes/0001-fbdev-fbmem-behave-better-with-small-rotated-display.patch
patches.fixes/0001-fbdev-fbcon-Fix-unregister-crash-when-more-than-one-.patch
+ patches.fixes/0001-drm-fb-helper-Ignore-the-value-of-fb_var_screeninfo..patch
########################################################
# end of sorted patches