]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/fbdev-sm712fb-fix-vram-detection-don-t-set-sr70-71-74-75.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / fbdev-sm712fb-fix-vram-detection-don-t-set-sr70-71-74-75.patch
CommitLineData
53722911
GKH
1From dcf9070595e100942c539e229dde4770aaeaa4e9 Mon Sep 17 00:00:00 2001
2From: Yifeng Li <tomli@tomli.me>
3Date: Mon, 1 Apr 2019 17:46:58 +0200
4Subject: fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75
5
6From: Yifeng Li <tomli@tomli.me>
7
8commit dcf9070595e100942c539e229dde4770aaeaa4e9 upstream.
9
10On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), the amount of Video
11RAM is not detected correctly by the xf86-video-siliconmotion driver.
12This is because sm712fb overwrites the GPR71 Scratch Pad Register, which
13is set by BIOS on x86 and used to indicate amount of VRAM.
14
15Other Scratch Pad Registers, including GPR70/74/75, don't have the same
16side-effect, but overwriting to them is still questionable, as they are
17not related to modesetting.
18
19Stop writing to SR70/71/74/75 (a.k.a GPR70/71/74/75).
20
21Signed-off-by: Yifeng Li <tomli@tomli.me>
22Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
23Cc: Teddy Wang <teddy.wang@siliconmotion.com>
24Cc: <stable@vger.kernel.org> # v4.4+
25Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
26Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27
28---
29 drivers/video/fbdev/sm712fb.c | 4 +++-
30 1 file changed, 3 insertions(+), 1 deletion(-)
31
32--- a/drivers/video/fbdev/sm712fb.c
33+++ b/drivers/video/fbdev/sm712fb.c
34@@ -1145,7 +1145,9 @@ static void sm7xx_set_timing(struct smtc
35 /* init SEQ register SR30 - SR75 */
36 for (i = 0; i < SIZE_SR30_SR75; i++)
37 if ((i + 0x30) != 0x30 && (i + 0x30) != 0x62 &&
38- (i + 0x30) != 0x6a && (i + 0x30) != 0x6b)
39+ (i + 0x30) != 0x6a && (i + 0x30) != 0x6b &&
40+ (i + 0x30) != 0x70 && (i + 0x30) != 0x71 &&
41+ (i + 0x30) != 0x74 && (i + 0x30) != 0x75)
42 smtc_seqw(i + 0x30,
43 vgamode[j].init_sr30_sr75[i]);
44