<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/video/fbdev/sm712fb.c, branch v5.5</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-08-19T13:52:24Z</updated>
<entry>
<title>video: fbdev: sm712fb: Use dev_get_drvdata</title>
<updated>2019-08-19T13:52:24Z</updated>
<author>
<name>Chuhong Yuan</name>
<email>hslester96@gmail.com</email>
</author>
<published>2019-07-24T13:17:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=70fc43c0998d52714c80a96d5e74f8b126e1f8b4'/>
<id>urn:sha1:70fc43c0998d52714c80a96d5e74f8b126e1f8b4</id>
<content type='text'>
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

Signed-off-by: Chuhong Yuan &lt;hslester96@gmail.com&gt;
Cc: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Teddy Wang &lt;teddy.wang@siliconmotion.com&gt;
[b.zolnierkie: fix patch summary]
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190724131744.1709-1-hslester96@gmail.com
</content>
</entry>
<entry>
<title>video: fbdev: don't print error message on framebuffer_alloc() failure</title>
<updated>2019-06-28T10:30:08Z</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>b.zolnierkie@samsung.com</email>
</author>
<published>2019-06-28T10:30:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0adcdbcb179624d7b3677264f2cd228e7d89eea9'/>
<id>urn:sha1:0adcdbcb179624d7b3677264f2cd228e7d89eea9</id>
<content type='text'>
framebuffer_alloc() can fail only on kzalloc() memory allocation
failure and since kzalloc() will print error message in such case
we can omit printing extra error message in drivers (which BTW is
what the majority of framebuffer_alloc() users is doing already).

Cc: "Bruno Prémont" &lt;bonbons@linux-vserver.org&gt;
Cc: Jiri Kosina &lt;jikos@kernel.org&gt;
Cc: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>fbdev: sm712fb: fix memory frequency by avoiding a switch/case fallthrough</title>
<updated>2019-04-02T15:14:10Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-04-02T15:14:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9dc20113988b9a75ea6b3abd68dc45e2d73ccdab'/>
<id>urn:sha1:9dc20113988b9a75ea6b3abd68dc45e2d73ccdab</id>
<content type='text'>
A fallthrough in switch/case was introduced in f627caf55b8e ("fbdev:
sm712fb: fix crashes and garbled display during DPMS modesetting"),
due to my copy-paste error, which would cause the memory clock frequency
for SM720 to be programmed to SM712.

Since it only reprograms the clock to a different frequency, it's only
a benign issue without visible side-effect, so it also evaded Sudip
Mukherjee's code review and regression tests. scripts/checkpatch.pl
also failed to discover the issue, possibly due to nested switch
statements.

This issue was found by Stephen Rothwell by building linux-next with
-Wimplicit-fallthrough.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Fixes: f627caf55b8e ("fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting")
Signed-off-by: Yifeng Li &lt;tomli@tomli.me&gt;
Cc: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: "Gustavo A. R. Silva" &lt;gustavo@embeddedor.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>fbdev: sm712fb: use 1024x768 by default on non-MIPS, fix garbled display</title>
<updated>2019-04-01T15:46:59Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-04-01T15:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4ed7d2ccb7684510ec5f7a8f7ef534bc6a3d55b2'/>
<id>urn:sha1:4ed7d2ccb7684510ec5f7a8f7ef534bc6a3d55b2</id>
<content type='text'>
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.

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 &lt;tomli@tomli.me&gt;
Tested-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Teddy Wang &lt;teddy.wang@siliconmotion.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>fbdev: sm712fb: fix support for 1024x768-16 mode</title>
<updated>2019-04-01T15:46:59Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-04-01T15:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6053d3a4793e5bde6299ac5388e76a3bf679ff65'/>
<id>urn:sha1:6053d3a4793e5bde6299ac5388e76a3bf679ff65</id>
<content type='text'>
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 &lt;tomli@tomli.me&gt;
Tested-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Teddy Wang &lt;teddy.wang@siliconmotion.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting</title>
<updated>2019-04-01T15:46:59Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-04-01T15:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f627caf55b8e735dcec8fa6538e9668632b55276'/>
<id>urn:sha1:f627caf55b8e735dcec8fa6538e9668632b55276</id>
<content type='text'>
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.

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 &lt;tomli@tomli.me&gt;
Tested-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Teddy Wang &lt;teddy.wang@siliconmotion.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>fbdev: sm712fb: fix crashes during framebuffer writes by correctly mapping VRAM</title>
<updated>2019-04-01T15:46:59Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-04-01T15:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9e0e59993df0601cddb95c4f6c61aa3d5e753c00'/>
<id>urn:sha1:9e0e59993df0601cddb95c4f6c61aa3d5e753c00</id>
<content type='text'>
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.

Signed-off-by: Yifeng Li &lt;tomli@tomli.me&gt;
Tested-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Teddy Wang &lt;teddy.wang@siliconmotion.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>fbdev: sm712fb: fix boot screen glitch when sm712fb replaces VGA</title>
<updated>2019-04-01T15:46:59Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-04-01T15:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ec1587d5073f29820e358f3a383850d61601d981'/>
<id>urn:sha1:ec1587d5073f29820e358f3a383850d61601d981</id>
<content type='text'>
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 &lt;tomli@tomli.me&gt;
Tested-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Teddy Wang &lt;teddy.wang@siliconmotion.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>fbdev: sm712fb: fix VRAM detection, don't set SR70/71/74/75</title>
<updated>2019-04-01T15:46:58Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-04-01T15:46:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dcf9070595e100942c539e229dde4770aaeaa4e9'/>
<id>urn:sha1:dcf9070595e100942c539e229dde4770aaeaa4e9</id>
<content type='text'>
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.

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 &lt;tomli@tomli.me&gt;
Tested-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Teddy Wang &lt;teddy.wang@siliconmotion.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
<entry>
<title>fbdev: sm712fb: fix brightness control on reboot, don't set SR30</title>
<updated>2019-04-01T15:46:58Z</updated>
<author>
<name>Yifeng Li</name>
<email>tomli@tomli.me</email>
</author>
<published>2019-04-01T15:46:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5481115e25e42b9215f2619452aa99c95f08492f'/>
<id>urn:sha1:5481115e25e42b9215f2619452aa99c95f08492f</id>
<content type='text'>
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.

Stop writing to the SR30 (a.k.a FPR30) register.

Signed-off-by: Yifeng Li &lt;tomli@tomli.me&gt;
Tested-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Teddy Wang &lt;teddy.wang@siliconmotion.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v4.4+
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
</content>
</entry>
</feed>
