* [PATCH] matroxfb: perform a dummy read of M_STATUS
@ 2014-05-15 10:58 Mikulas Patocka
2014-05-23 10:45 ` Tomi Valkeinen
0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2014-05-15 10:58 UTC (permalink / raw)
To: linux-fbdev
I had occasional screen corruption with the matrox framebuffer driver and
I found out that the reason for the corruption is that the hardware
blitter accesses the videoram while it is being written to.
The matrox driver has a macro WaitTillIdle() that should wait until the
blitter is idle, but it sometimes doesn't work. I added a dummy read
mga_inl(M_STATUS) to WaitTillIdle() to fix the problem. The dummy read
will flush the write buffer in the PCI chipset, and the next read of
M_STATUS will return the hardware status.
Since applying this patch, I had no screen corruption at all.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
---
drivers/video/matrox/matroxfb_base.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-3.14/drivers/video/matrox/matroxfb_base.h
=================================--- linux-3.14.orig/drivers/video/matrox/matroxfb_base.h 2014-04-08 00:35:19.460051657 +0200
+++ linux-3.14/drivers/video/matrox/matroxfb_base.h 2014-05-03 18:38:18.882396833 +0200
@@ -698,7 +698,7 @@ void matroxfb_unregister_driver(struct m
#define mga_fifo(n) do {} while ((mga_inl(M_FIFOSTATUS) & 0xFF) < (n))
-#define WaitTillIdle() do {} while (mga_inl(M_STATUS) & 0x10000)
+#define WaitTillIdle() do { mga_inl(M_STATUS); do {} while (mga_inl(M_STATUS) & 0x10000); } while (0)
/* code speedup */
#ifdef CONFIG_FB_MATROX_MILLENIUM
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] matroxfb: perform a dummy read of M_STATUS
2014-05-15 10:58 [PATCH] matroxfb: perform a dummy read of M_STATUS Mikulas Patocka
@ 2014-05-23 10:45 ` Tomi Valkeinen
0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2014-05-23 10:45 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 794 bytes --]
On 15/05/14 13:58, Mikulas Patocka wrote:
> I had occasional screen corruption with the matrox framebuffer driver and
> I found out that the reason for the corruption is that the hardware
> blitter accesses the videoram while it is being written to.
>
> The matrox driver has a macro WaitTillIdle() that should wait until the
> blitter is idle, but it sometimes doesn't work. I added a dummy read
> mga_inl(M_STATUS) to WaitTillIdle() to fix the problem. The dummy read
> will flush the write buffer in the PCI chipset, and the next read of
> M_STATUS will return the hardware status.
>
> Since applying this patch, I had no screen corruption at all.
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Cc: stable@vger.kernel.org
>
Queued for 3.16.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-23 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15 10:58 [PATCH] matroxfb: perform a dummy read of M_STATUS Mikulas Patocka
2014-05-23 10:45 ` Tomi Valkeinen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.