]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.9/fbdev-sm712fb-fix-vram-detection-don-t-set-sr70-71-74-75.patch
Linux 4.14.122
[thirdparty/kernel/stable-queue.git] / queue-4.9 / fbdev-sm712fb-fix-vram-detection-don-t-set-sr70-71-74-75.patch
1 From dcf9070595e100942c539e229dde4770aaeaa4e9 Mon Sep 17 00:00:00 2001
2 From: Yifeng Li <tomli@tomli.me>
3 Date: Mon, 1 Apr 2019 17:46:58 +0200
4 Subject: fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75
5
6 From: Yifeng Li <tomli@tomli.me>
7
8 commit dcf9070595e100942c539e229dde4770aaeaa4e9 upstream.
9
10 On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), the amount of Video
11 RAM is not detected correctly by the xf86-video-siliconmotion driver.
12 This is because sm712fb overwrites the GPR71 Scratch Pad Register, which
13 is set by BIOS on x86 and used to indicate amount of VRAM.
14
15 Other Scratch Pad Registers, including GPR70/74/75, don't have the same
16 side-effect, but overwriting to them is still questionable, as they are
17 not related to modesetting.
18
19 Stop writing to SR70/71/74/75 (a.k.a GPR70/71/74/75).
20
21 Signed-off-by: Yifeng Li <tomli@tomli.me>
22 Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
23 Cc: Teddy Wang <teddy.wang@siliconmotion.com>
24 Cc: <stable@vger.kernel.org> # v4.4+
25 Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
26 Signed-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