fbdev: sm712fb: fix a series of lockups, crashes and gliches.
cover fbdev: sm712fb: fix a series of lockups, crashes and gliches.
Hi all,
This patchset contains a series of important fixes to various problems, including lockups, crashes, screen gliches, and missing video modes. These patches are crucial to the correct operation to the hardware, especially Lynx3DM+ (SM720). I have tested and verified them on x86.
Please review and queue them for linux-stable.
Thanks,
Yifeng Li (8):
fbdev: sm712fb: fix white screen of death on reboot, don't set
CR3B-CR3F.
fbdev: sm712fb: fix brightness control on reboot, don't set SR30.
fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75.
fbdev: sm712fb: fix boot screen glitch when sm712fb replaces VGA.
fbdev: sm712fb: fix crashes during framebuffer writes by correctly
mapping VRAM.
fbdev: sm712fb: fix crashes and garbled display during DPMS
modesetting.
fbdev: sm712fb: fix support for 1024x768-16 mode.
fbdev: sm712fb: use 1024x768 by default on non-MIPS, fix garbled
display.
drivers/video/fbdev/sm712.h | 12 +- drivers/video/fbdev/sm712fb.c | 244 +++++++++++++++++++++++++++------- 2 files changed, 200 insertions(+), 56 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/8 fbdev: sm712fb: fix white screen of death on reboot, don't set CR3B-CR3F.
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), rebooting with sm712fb framebuffer driver would cause a white screen of death on the next POST, presumably the proper timings for the LCD panel was not reprogrammed properly by the BIOS.
Experiments showed a few CRTC Scratch Registers, including CRT3D, CRT3E and CRT3F may be used internally by BIOS as some flags. CRT3B is a hardware testing register, we shouldn't mess with it. CRT3C has blanking signal and line compare control, which is not needed for this driver.
Stop writing to CR3B-CR3F (a.k.a CRT3B-CRT3F) registers. Even if these registers don't have side-effect on other systems, writing to them is also highly questionable.
--- drivers/video/fbdev/sm712fb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/video/fbdev/sm712fb.c +5 -1
@@ -1171,8 +1171,12 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)smtc_crtcw (i, vgamode[j].init_cr00_cr18[i]);/* init CRTC register CR30 - CR4D */ -for (i =0 ; i <SIZE_CR30_CR4D ; i++) +for (i =0 ; i <SIZE_CR30_CR4D ; i++) { +if ((i +0x30 ) >=0x3B && (i +0x30 ) <=0x3F ) +/* side-effect, don't write to CR3B-CR3F */ +continue ;smtc_crtcw (i +0x30 , vgamode[j].init_cr30_cr4d[i]); + }/* init CRTC register CR90 - CRA7 */ for (i =0 ; i <SIZE_CR90_CRA7 ; i++)
Signature · 1 line
2.20.1
Re: [PATCH 1/8] fbdev: sm712fb: fix white screen of death on reboot, don't set CR3B-CR3F.
Quoted 11 lines · Yifeng Li
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), rebooting with sm712fb framebuffer driver would cause a white screen of death on the next POST, presumably the proper timings for the LCD panel was not reprogrammed properly by the BIOS.
Experiments showed a few CRTC Scratch Registers, including CRT3D, CRT3E and CRT3F may be used internally by BIOS as some flags. CRT3B is a hardware testing register, we shouldn't mess with it. CRT3C has blanking signal and line compare control, which is not needed for this driver.
Quoted 6 lines
Stop writing to CR3B-CR3F (a.k.a CRT3B-CRT3F) registers. Even if these registers don't have side-effect on other systems, writing to them is also highly questionable.
Signed-off-by Yifeng Li <[email protected]>Cc [email protected] # v4.4+
PATCH 2/8 fbdev: sm712fb: fix brightness control on reboot, don't set SR30.
In reply to Yifeng LiOn a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), rebooting with sm712fb framebuffer driver would cause the role of brightness up/down button to swap.
Experiments showed the FPR30 register caused this behavior. Moreover, even if this register don't have side-effect on other systems, over- writing it is also highly questionable, since it was originally configurated by the motherboard manufacturer by hardwiring pull-down resistors to indicate the type of LCD panel. We should not mess with it.
Stop writing to the SR30 (a.k.a FPR30) register.
--- drivers/video/fbdev/sm712fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/sm712fb.c +2 -2
@@ -1145,8 +1145,8 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)/* init SEQ register SR30 - SR75 */ for (i =0 ; i <SIZE_SR30_SR75 ; i++) -if ((i +0x30 ) !=0x62 && (i +0x30 ) !=0x6a && - (i +0x30 ) !=0x6b ) +if ((i +0x30 ) !=0x30 && (i +0x30 ) !=0x62 && + (i +0x30 ) !=0x6a && (i +0x30 ) !=0x6b )smtc_seqw (i +0x30 , vgamode[j].init_sr30_sr75[i]);
Signature · 1 line
2.20.1
Re: [PATCH 2/8] fbdev: sm712fb: fix brightness control on reboot, don't set SR30.
Quoted 11 lines · Yifeng Li
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), rebooting with sm712fb framebuffer driver would cause the role of brightness up/down button to swap.
Experiments showed the FPR30 register caused this behavior. Moreover, even if this register don't have side-effect on other systems, over- writing it is also highly questionable, since it was originally configurated by the motherboard manufacturer by hardwiring pull-down resistors to indicate the type of LCD panel. We should not mess with it.
Quoted 4 lines
Stop writing to the SR30 (a.k.a FPR30) register.
Signed-off-by Yifeng Li <[email protected]>Cc [email protected] # v4.4+
--
Regards
Sudip
PATCH 3/8 fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75.
In reply to Yifeng LiOn a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), the amount of Video RAM is not detected correctly by the xf86-video-siliconmotion driver. This is because sm712fb overwrites the GPR71 Scratch Pad Register, which is set by BIOS on x86 and used to indicate amount of VRAM.
Other Scratch Pad Registers, including GPR70/74/75, don't have the same side-effect, but overwriting to them is still questionable, as they are not related to modesetting.
Stop writing to SR70/71/74/75 (a.k.a GPR70/71/74/75).
--- drivers/video/fbdev/sm712fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/fbdev/sm712fb.c +3 -1
@@ -1146,7 +1146,9 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)/* init SEQ register SR30 - SR75 */ for (i =0 ; i <SIZE_SR30_SR75 ; i++)if ((i +0x30 ) !=0x30 && (i +0x30 ) !=0x62 && - (i +0x30 ) !=0x6a && (i +0x30 ) !=0x6b ) + (i +0x30 ) !=0x6a && (i +0x30 ) !=0x6b && + (i +0x30 ) !=0x70 && (i +0x30 ) !=0x71 && + (i +0x30 ) !=0x74 && (i +0x30 ) !=0x75 )smtc_seqw (i +0x30 , vgamode[j].init_sr30_sr75[i]);
Signature · 1 line
2.20.1
Re: [PATCH 3/8] fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75.
Quoted 5 lines · Yifeng Li
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), the amount of Video RAM is not detected correctly by the xf86-video-siliconmotion driver. This is because sm712fb overwrites the GPR71 Scratch Pad Register, which is set by BIOS on x86 and used to indicate amount of VRAM.
Quoted 8 lines
Other Scratch Pad Registers, including GPR70/74/75, don't have the same side-effect, but overwriting to them is still questionable, as they are not related to modesetting.
Stop writing to SR70/71/74/75 (a.k.a GPR70/71/74/75).
Signed-off-by Yifeng Li <[email protected]>Cc [email protected] # v4.4+
--
Regards
Sudip
PATCH 4/8 fbdev: sm712fb: fix boot screen glitch when sm712fb replaces VGA.
In reply to Yifeng LiWhen the machine is booted in VGA mode, loading sm712fb would cause a glitch of random pixels shown on the screen. To prevent it from happening, we first clear the entire framebuffer, and we also need to stop calling smtcfb_setmode() during initialization, the fbdev layer will call it for us later when it's ready.
--- drivers/video/fbdev/sm712fb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/video/fbdev/sm712fb.c +5 -1
@@ -1493,7 +1493,11 @@ static int smtcfb_pci_probe(struct pci_dev *pdev,if (err) goto failed; -smtcfb_setmode (sfb); +/* +* The screen would be temporarily garbled when sm712fb takes over +* vesafb or VGA text mode. Zero the framebuffer. +*/ +memset_io (sfb->lfb,0 , sfb->fb->fix.smem_len); err =register_framebuffer (info);if (err <0 )
Signature · 1 line
2.20.1
Re: [PATCH 4/8] fbdev: sm712fb: fix boot screen glitch when sm712fb replaces VGA.
Quoted 8 lines · Yifeng Li
When the machine is booted in VGA mode, loading sm712fb would cause a glitch of random pixels shown on the screen. To prevent it from happening, we first clear the entire framebuffer, and we also need to stop calling
smtcfb_setmode()during initialization, the fbdev layer will call it for us later when it's ready.Signed-off-by Yifeng Li <[email protected]>Cc [email protected] # v4.4+
--
Regards
Sudip
PATCH 5/8 fbdev: sm712fb: fix crashes during framebuffer writes by correctly mapping VRAM.
In reply to Yifeng LiOn a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), running fbtest or X will crash the machine instantly, because the VRAM/framebuffer is not mapped correctly.
On SM712, the framebuffer starts at the beginning of address space, but SM720's framebuffer starts at the 1 MiB offset from the beginning. However, sm712fb fails to take this into account, as a result, writing to the framebuffer will destroy all the registers and kill the system immediately. Another problem is the driver assumes 8 MiB of VRAM for SM720, but some SM720 system, such as this IBM Thinkpad, only has 4 MiB of VRAM.
Fix this problem by removing the hardcoded VRAM size, adding a function to query the amount of VRAM from register MCR76 on SM720, and adding proper framebuffer offset.
Please note that the memory map may have additional problems on Big-Endian system, which is not available for testing by myself. But I highly suspect that the original code is also broken on Big-Endian machines for SM720, so at least we are not making the problem worse. More, the driver also assumed SM710/SM712 has 4 MiB of VRAM, but it has a 2 MiB version as well, and used in earlier laptops, such as IBM Thinkpad 240X, the driver would probably crash on them. I've never seen one of those machines and cannot fix it, but I have documented these problems in the comments.
--- drivers/video/fbdev/sm712.h | 5 ---- drivers/video/fbdev/sm712fb.c | 48 ++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 9 deletions(-)
drivers/video/fbdev/sm712.h +0 -5
@@ -19,11 +19,6 @@#define SCREEN_Y_RES 600#define SCREEN_BPP 16 -/*Assume SM712 graphics chip has 4MB VRAM */ -#define SM712_VIDEOMEMORYSIZE 0x00400000 -/*Assume SM722 graphics chip has 8MB VRAM */ -#define SM722_VIDEOMEMORYSIZE 0x00800000 -#define dac_reg (0x3c8)#define dac_val (0x3c9)
drivers/video/fbdev/sm712fb.c +44 -4
82 lines not on this page · raw message
Signature · 1 line
2.20.1
Sudip Mukherjee
maintainerRe: [PATCH 5/8] fbdev: sm712fb: fix crashes during framebuffer writes by correctly mapping VRAM.
Hi Teddy,
Quoted 15 lines · Yifeng Li
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), running fbtest or X will crash the machine instantly, because the VRAM/framebuffer is not mapped correctly.
On SM712, the framebuffer starts at the beginning of address space, but SM720's framebuffer starts at the 1 MiB offset from the beginning. However, sm712fb fails to take this into account, as a result, writing to the framebuffer will destroy all the registers and kill the system immediately. Another problem is the driver assumes 8 MiB of VRAM for SM720, but some SM720 system, such as this IBM Thinkpad, only has 4 MiB of VRAM.
Fix this problem by removing the hardcoded VRAM size, adding a function to query the amount of VRAM from register MCR76 on SM720, and adding proper framebuffer offset.
Quoted 8 lines
Please note that the memory map may have additional problems on Big-Endian system, which is not available for testing by myself. But I highly suspect that the original code is also broken on Big-Endian machines for SM720, so at least we are not making the problem worse. More, the driver also assumed SM710/SM712 has 4 MiB of VRAM, but it has a 2 MiB version as well, and used in earlier laptops, such as IBM Thinkpad 240X, the driver would probably crash on them. I've never seen one of those machines and cannot fix it, but I have documented these problems in the comments.
I only have access to SM712 and I am testing this series on it. Can you please test them on SM710, SM720 and also on big-endian machine, specially the patches from 5 to 8.
Re: [PATCH 5/8] fbdev: sm712fb: fix crashes during framebuffer writes by correctly mapping VRAM.
In reply to Yifeng LiQuoted 24 lines · Yifeng Li
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), running fbtest or X will crash the machine instantly, because the VRAM/framebuffer is not mapped correctly.
On SM712, the framebuffer starts at the beginning of address space, but SM720's framebuffer starts at the 1 MiB offset from the beginning. However, sm712fb fails to take this into account, as a result, writing to the framebuffer will destroy all the registers and kill the system immediately. Another problem is the driver assumes 8 MiB of VRAM for SM720, but some SM720 system, such as this IBM Thinkpad, only has 4 MiB of VRAM.
Fix this problem by removing the hardcoded VRAM size, adding a function to query the amount of VRAM from register MCR76 on SM720, and adding proper framebuffer offset.
Please note that the memory map may have additional problems on Big-Endian system, which is not available for testing by myself. But I highly suspect that the original code is also broken on Big-Endian machines for SM720, so at least we are not making the problem worse. More, the driver also assumed SM710/SM712 has 4 MiB of VRAM, but it has a 2 MiB version as well, and used in earlier laptops, such as IBM Thinkpad 240X, the driver would probably crash on them. I've never seen one of those machines and cannot fix it, but I have documented these problems in the comments.
Quoted 2 lines
Signed-off-by Yifeng Li <[email protected]>Cc [email protected] # v4.4+
--
Regards
Sudip
PATCH 6/8 fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting.
In reply to Yifeng LiOn a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), blanking the display or starting the X server will crash and freeze the system, or garble the display.
Experiments showed this problem can mostly be solved by adjusting the order of register writes. Also, sm712fb failed to consider the difference of clock frequency when unblanking the display, and programs the clock for SM712 to SM720.
Fix them by adjusting the order of register writes, and adding an additional check for SM720 for programming the clock frequency.
--- drivers/video/fbdev/sm712fb.c | 64 +++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 26 deletions(-)
drivers/video/fbdev/sm712fb.c +38 -26
@@ -827,67 +827,79 @@ static inline unsigned int chan_to_field(unsigned int chan,static int smtc_blank (int blank_mode,struct fb_info *info) { +struct smtcfb_info *sfb = info->par; +/* clear DPMS setting */ switch (blank_mode) {case FB_BLANK_UNBLANK :/* Screen On: HSync: On, VSync : On */ + +switch (sfb->chip_id) { +case 0x710 : +case 0x712 : +smtc_seqw (0x6a ,0x16 ); +smtc_seqw (0x6b ,0x02 ); +case 0x720 : +smtc_seqw (0x6a ,0x0d ); +smtc_seqw (0x6b ,0x02 ); +break ; + } + +smtc_seqw (0x23 , (smtc_seqr (0x23 ) & (~0xc0 )));smtc_seqw (0x01 , (smtc_seqr (0x01 ) & (~0x20 ))); -smtc_seqw (0x6a ,0x16 ); -smtc_seqw (0x6b ,0x02 );smtc_seqw (0x21 , (smtc_seqr (0x21 ) &0x77 ));smtc_seqw (0x22 , (smtc_seqr (0x22 ) & (~0x30 ))); -smtc_seqw (0x23 , (smtc_seqr (0x23 ) & (~0xc0 ))); -smtc_seqw (0x24 , (smtc_seqr (0x24 ) |0x01 ));smtc_seqw (0x31 , (smtc_seqr (0x31 ) |0x03 )); +smtc_seqw (0x24 , (smtc_seqr (0x24 ) |0x01 ));break ;case FB_BLANK_NORMAL :/* Screen Off: HSync: On, VSync : On Soft blank */ +smtc_seqw (0x24 , (smtc_seqr (0x24 ) |0x01 )); +smtc_seqw (0x31 , ((smtc_seqr (0x31 ) & (~0x07 )) |0x00 )); +smtc_seqw (0x23 , (smtc_seqr (0x23 ) & (~0xc0 )));smtc_seqw (0x01 , (smtc_seqr (0x01 ) & (~0x20 ))); +smtc_seqw (0x22 , (smtc_seqr (0x22 ) & (~0x30 )));smtc_seqw (0x6a ,0x16 );smtc_seqw (0x6b ,0x02 ); -smtc_seqw (0x22 , (smtc_seqr (0x22 ) & (~0x30 ))); -smtc_seqw (0x23 , (smtc_seqr (0x23 ) & (~0xc0 ))); -smtc_seqw (0x24 , (smtc_seqr (0x24 ) |0x01 )); -smtc_seqw (0x31 , ((smtc_seqr (0x31 ) & (~0x07 )) |0x00 ));break ;case FB_BLANK_VSYNC_SUSPEND :/* Screen On: HSync: On, VSync : Off */ +smtc_seqw (0x24 , (smtc_seqr (0x24 ) & (~0x01 ))); +smtc_seqw (0x31 , ((smtc_seqr (0x31 ) & (~0x07 )) |0x00 )); +smtc_seqw (0x23 , ((smtc_seqr (0x23 ) & (~0xc0 )) |0x20 ));smtc_seqw (0x01 , (smtc_seqr (0x01 ) |0x20 )); -smtc_seqw (0x20 , (smtc_seqr (0x20 ) & (~0xB0 ))); -smtc_seqw (0x6a ,0x0c ); -smtc_seqw (0x6b ,0x02 );smtc_seqw (0x21 , (smtc_seqr (0x21 ) |0x88 )); +smtc_seqw (0x20 , (smtc_seqr (0x20 ) & (~0xB0 )));smtc_seqw (0x22 , ((smtc_seqr (0x22 ) & (~0x30 )) |0x20 )); -smtc_seqw (0x23 , ((smtc_seqr (0x23 ) & (~0xc0 )) |0x20 )); -smtc_seqw (0x24 , (smtc_seqr (0x24 ) & (~0x01 ))); -smtc_seqw (0x31 , ((smtc_seqr (0x31 ) & (~0x07 )) |0x00 ));smtc_seqw (0x34 , (smtc_seqr (0x34 ) |0x80 )); +smtc_seqw (0x6a ,0x0c ); +smtc_seqw (0x6b ,0x02 );break ;case FB_BLANK_HSYNC_SUSPEND :/* Screen On: HSync: Off, VSync : On */ +smtc_seqw (0x24 , (smtc_seqr (0x24 ) & (~0x01 ))); +smtc_seqw (0x31 , ((smtc_seqr (0x31 ) & (~0x07 )) |0x00 )); +smtc_seqw (0x23 , ((smtc_seqr (0x23 ) & (~0xc0 )) |0xD8 ));smtc_seqw (0x01 , (smtc_seqr (0x01 ) |0x20 )); -smtc_seqw (0x20 , (smtc_seqr (0x20 ) & (~0xB0 ))); -smtc_seqw (0x6a ,0x0c ); -smtc_seqw (0x6b ,0x02 );smtc_seqw (0x21 , (smtc_seqr (0x21 ) |0x88 )); +smtc_seqw (0x20 , (smtc_seqr (0x20 ) & (~0xB0 )));smtc_seqw (0x22 , ((smtc_seqr (0x22 ) & (~0x30 )) |0x10 )); -smtc_seqw (0x23 , ((smtc_seqr (0x23 ) & (~0xc0 )) |0xD8 )); -smtc_seqw (0x24 , (smtc_seqr (0x24 ) & (~0x01 ))); -smtc_seqw (0x31 , ((smtc_seqr (0x31 ) & (~0x07 )) |0x00 ));smtc_seqw (0x34 , (smtc_seqr (0x34 ) |0x80 )); +smtc_seqw (0x6a ,0x0c ); +smtc_seqw (0x6b ,0x02 );break ;case FB_BLANK_POWERDOWN :/* Screen On: HSync: Off, VSync : Off */ +smtc_seqw (0x24 , (smtc_seqr (0x24 ) & (~0x01 ))); +smtc_seqw (0x31 , ((smtc_seqr (0x31 ) & (~0x07 )) |0x00 )); +smtc_seqw (0x23 , ((smtc_seqr (0x23 ) & (~0xc0 )) |0xD8 ));smtc_seqw (0x01 , (smtc_seqr (0x01 ) |0x20 )); -smtc_seqw (0x20 , (smtc_seqr (0x20 ) & (~0xB0 ))); -smtc_seqw (0x6a ,0x0c ); -smtc_seqw (0x6b ,0x02 );smtc_seqw (0x21 , (smtc_seqr (0x21 ) |0x88 )); +smtc_seqw (0x20 , (smtc_seqr (0x20 ) & (~0xB0 )));smtc_seqw (0x22 , ((smtc_seqr (0x22 ) & (~0x30 )) |0x30 )); -smtc_seqw (0x23 , ((smtc_seqr (0x23 ) & (~0xc0 )) |0xD8 )); -smtc_seqw (0x24 , (smtc_seqr (0x24 ) & (~0x01 ))); -smtc_seqw (0x31 , ((smtc_seqr (0x31 ) & (~0x07 )) |0x00 ));smtc_seqw (0x34 , (smtc_seqr (0x34 ) |0x80 )); +smtc_seqw (0x6a ,0x0c ); +smtc_seqw (0x6b ,0x02 );break ;default :return -EINVAL ;
Signature · 1 line
2.20.1
Re: [PATCH 6/8] fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting.
Quoted 9 lines · Yifeng Li
On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), blanking the display or starting the X server will crash and freeze the system, or garble the display.
Experiments showed this problem can mostly be solved by adjusting the order of register writes. Also, sm712fb failed to consider the difference of clock frequency when unblanking the display, and programs the clock for SM712 to SM720.
Quoted 5 lines
Fix them by adjusting the order of register writes, and adding an additional check for SM720 for programming the clock frequency.
Signed-off-by Yifeng Li <[email protected]>Cc [email protected] # v4.4+
--
Regards
Sudip
PATCH 7/8 fbdev: sm712fb: fix support for 1024x768-16 mode.
In reply to Yifeng LiIn order to support the 1024x600 panel on Yeeloong Loongson MIPS laptop, the original 1024x768-16 table was modified to 1024x600-16, without leaving the original. It causes problem on x86 laptop as the 1024x768-16 support was still claimed but not working.
Fix it by introducing the 1024x768-16 mode.
--- drivers/video/fbdev/sm712fb.c | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+)
drivers/video/fbdev/sm712fb.c +59 -0
@@ -530,6 +530,65 @@ static const struct modeinit vgamode[] = {0x03 ,0x03 ,0x03 ,0x03 ,0x03 ,0x03 ,0x15 ,0x03 , }, }, + { /* 1024 x 768 16Bpp 60Hz */ +1024 ,768 ,16 ,60 , +/* Init_MISC */ +0xEB , + { /* Init_SR0_SR4 */ +0x03 ,0x01 ,0x0F ,0x03 ,0x0E , + }, + { /* Init_SR10_SR24 */ +0xF3 ,0xB6 ,0xC0 ,0xDD ,0x00 ,0x0E ,0x17 ,0x2C , +0x99 ,0x02 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0xC4 ,0x30 ,0x02 ,0x01 ,0x01 , + }, + { /* Init_SR30_SR75 */ +0x38 ,0x03 ,0x20 ,0x09 ,0xC0 ,0x3A ,0x3A ,0x3A , +0x3A ,0x3A ,0x3A ,0x3A ,0x00 ,0x00 ,0x03 ,0xFF , +0x00 ,0xFC ,0x00 ,0x00 ,0x20 ,0x18 ,0x00 ,0xFC , +0x20 ,0x0C ,0x44 ,0x20 ,0x00 ,0x00 ,0x00 ,0x3A , +0x06 ,0x68 ,0xA7 ,0x7F ,0x83 ,0x24 ,0xFF ,0x03 , +0x0F ,0x60 ,0x59 ,0x3A ,0x3A ,0x00 ,0x00 ,0x3A , +0x01 ,0x80 ,0x7E ,0x1A ,0x1A ,0x00 ,0x00 ,0x00 , +0x50 ,0x03 ,0x74 ,0x14 ,0x3B ,0x0D ,0x09 ,0x02 , +0x04 ,0x45 ,0x30 ,0x30 ,0x40 ,0x20 , + }, + { /* Init_SR80_SR93 */ +0xFF ,0x07 ,0x00 ,0xFF ,0xFF ,0xFF ,0xFF ,0x3A , +0xF7 ,0x00 ,0x00 ,0x00 ,0xFF ,0xFF ,0x3A ,0x3A , +0x00 ,0x00 ,0x00 ,0x00 , + }, + { /* Init_SRA0_SRAF */ +0x00 ,0xFB ,0x9F ,0x01 ,0x00 ,0xED ,0xED ,0xED , +0x7B ,0xFB ,0xFF ,0xFF ,0x97 ,0xEF ,0xBF ,0xDF , + }, + { /* Init_GR00_GR08 */ +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x40 ,0x05 ,0x0F , +0xFF , + }, + { /* Init_AR00_AR14 */ +0x00 ,0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,0x06 ,0x07 , +0x08 ,0x09 ,0x0A ,0x0B ,0x0C ,0x0D ,0x0E ,0x0F , +0x41 ,0x00 ,0x0F ,0x00 ,0x00 , + }, + { /* Init_CR00_CR18 */ +0xA3 ,0x7F ,0x7F ,0x00 ,0x85 ,0x16 ,0x24 ,0xF5 , +0x00 ,0x60 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x03 ,0x09 ,0xFF ,0x80 ,0x40 ,0xFF ,0x00 ,0xE3 , +0xFF , + }, + { /* Init_CR30_CR4D */ +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x80 ,0x02 ,0x20 , +0x00 ,0x00 ,0x00 ,0x40 ,0x00 ,0xFF ,0xBF ,0xFF , +0xA3 ,0x7F ,0x00 ,0x86 ,0x15 ,0x24 ,0xFF ,0x00 , +0x01 ,0x07 ,0xE5 ,0x20 ,0x7F ,0xFF , + }, + { /* Init_CR90_CRA7 */ +0x55 ,0xD9 ,0x5D ,0xE1 ,0x86 ,0x1B ,0x8E ,0x26 , +0xDA ,0x8D ,0xDE ,0x94 ,0x00 ,0x00 ,0x18 ,0x00 , +0x03 ,0x03 ,0x03 ,0x03 ,0x03 ,0x03 ,0x15 ,0x03 , + }, + }, { /* mode#5: 1024 x 768 24Bpp 60Hz */1024 ,768 ,24 ,60 , /* Init_MISC */
Signature · 1 line
2.20.1
Re: [PATCH 7/8] fbdev: sm712fb: fix support for 1024x768-16 mode.
Quoted 9 lines · Yifeng Li
In order to support the 1024x600 panel on Yeeloong Loongson MIPS laptop, the original 1024x768-16 table was modified to 1024x600-16, without leaving the original. It causes problem on x86 laptop as the 1024x768-16 support was still claimed but not working.
Fix it by introducing the 1024x768-16 mode.
Signed-off-by Yifeng Li <[email protected]>Cc [email protected] # v4.4+
PATCH 8/8 fbdev: sm712fb: use 1024x768 by default on non-MIPS, fix garbled display.
In reply to Yifeng LiLoongson MIPS netbooks use 1024x600 LCD panels, which is the original target platform of this driver, but nearly all old x86 laptops have 1024x768. Lighting 768 panels using 600's timings would partially garble the display. Since it's not possible to distinguish them reliably, we change the default to 768, but keep 600 as-is on MIPS.
Further, earlier laptops, such as IBM Thinkpad 240X, has a 800x600 LCD panel, this driver would probably garbled those display. As we don't have one for testing, the original behavior of the driver is kept as-is, but the problem has been documented is the comments.
--- drivers/video/fbdev/sm712.h | 7 +++-- drivers/video/fbdev/sm712fb.c | 53 ++++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 16 deletions(-)
drivers/video/fbdev/sm712.h +4 -3
@@ -15,9 +15,10 @@#define FB_ACCEL_SMI_LYNX 88 -#define SCREEN_X_RES 1024 -#define SCREEN_Y_RES 600 -#define SCREEN_BPP 16 +#define SCREEN_X_RES 1024 +#define SCREEN_Y_RES_PC 768 +#define SCREEN_Y_RES_NETBOOK 600 +#define SCREEN_BPP 16#define dac_reg (0x3c8)#define dac_val (0x3c9)
drivers/video/fbdev/sm712fb.c +40 -13
71 lines not on this page · raw message
Signature · 1 line
2.20.1
Re: [PATCH 8/8] fbdev: sm712fb: use 1024x768 by default on non-MIPS, fix garbled display.
Quoted 6 lines · Yifeng Li
Loongson MIPS netbooks use 1024x600 LCD panels, which is the original target platform of this driver, but nearly all old x86 laptops have 1024x768. Lighting 768 panels using 600's timings would partially garble the display. Since it's not possible to distinguish them reliably, we change the default to 768, but keep 600 as-is on MIPS.
Quoted 7 lines
Further, earlier laptops, such as IBM Thinkpad 240X, has a 800x600 LCD panel, this driver would probably garbled those display. As we don't have one for testing, the original behavior of the driver is kept as-is, but the problem has been documented is the comments.
Signed-off-by Yifeng Li <[email protected]>Cc [email protected] # v4.4+
Sudip Mukherjee
maintainerQuoted 8 lines · Yifeng Li
Hi all,
This patchset contains a series of important fixes to various problems, including lockups, crashes, screen gliches, and missing video modes. These patches are crucial to the correct operation to the hardware, especially Lynx3DM+ (SM720). I have tested and verified them on x86.
Please review and queue them for linux-stable.
Thanks for the changes.
Verified the register changes from the datasheet and also tested the full series (separate test for individual patches) with SM712 on little endian for any regression.
--
Regards
Sudip
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Yifeng Li
Hi all,
This patchset contains a series of important fixes to various problems, including lockups, crashes, screen gliches, and missing video modes. These patches are crucial to the correct operation to the hardware, especially Lynx3DM+ (SM720). I have tested and verified them on x86.
Quoted 6 lines
Quoted 1 line
Please review and queue them for linux-stable.
Thanks for the changes.
Verified the register changes from the datasheet and also tested the full series (separate test for individual patches) with SM712 on little endian for any regression.
Patches #1-8 queued for v5.2, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics