All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix hardware accelerated video to video copy on Cirrus VGA
@ 2009-02-15  4:50 Brian Kress
  2009-02-15  5:23   ` C.W. Betts
  2009-02-16 14:59 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Kress @ 2009-02-15  4:50 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

    cirrus_do_copy() in hw/cirrus_vga.c seems to make some incorrect 
assumptions about video
memory layout.  It tries to convert addresses to coordinates assuming 
that one row of data is
(width * depth) bytes long.  The correct way seems to be to use the 
pitch fields in the
CirrusVGAState structure instead.
    Without this patch, I get lots of screen corruption when I try to 
drag a window under X as it's
passing the wrong coordinates to the display surface for the copy.  With 
this patch I can drag a
window with no screen corruption.



[-- Attachment #2: patch.cirrus_vga --]
[-- Type: text/plain, Size: 716 bytes --]

Signed-off-by: Brian Kressb <kressb@moose.net

Index: hw/cirrus_vga.c
===================================================================
--- hw/cirrus_vga.c	(revision 6619)
+++ hw/cirrus_vga.c	(working copy)
@@ -730,10 +730,10 @@
     s->get_resolution((VGAState *)s, &width, &height);
 
     /* extra x, y */
-    sx = (src % (width * depth)) / depth;
-    sy = (src / (width * depth));
-    dx = (dst % (width *depth)) / depth;
-    dy = (dst / (width * depth));
+    sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
+    sy = (src / ABS(s->cirrus_blt_srcpitch));
+    dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
+    dy = (dst / ABS(s->cirrus_blt_dstpitch));
 
     /* normalize width */
     w /= depth;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Fix hardware accelerated video to video copy on Cirrus VGA
@ 2009-02-15  5:23   ` C.W. Betts
  0 siblings, 0 replies; 3+ messages in thread
From: C.W. Betts @ 2009-02-15  5:23 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]

I have also noticed that, when emulating Rhapsody, if I have the color  
set to millions (32 bit) then it has issues redrawing lines.  I do not  
know if this patch will fix it, but I'll look into it.
On Feb 14, 2009, at 9:50 PM, Brian Kress wrote:

>   cirrus_do_copy() in hw/cirrus_vga.c seems to make some incorrect  
> assumptions about video
> memory layout.  It tries to convert addresses to coordinates  
> assuming that one row of data is
> (width * depth) bytes long.  The correct way seems to be to use the  
> pitch fields in the
> CirrusVGAState structure instead.
>   Without this patch, I get lots of screen corruption when I try to  
> drag a window under X as it's
> passing the wrong coordinates to the display surface for the copy.   
> With this patch I can drag a
> window with no screen corruption.
>
>
> Signed-off-by: Brian Kressb <kressb@moose.net
>
> Index: hw/cirrus_vga.c
> ===================================================================
> --- hw/cirrus_vga.c	(revision 6619)
> +++ hw/cirrus_vga.c	(working copy)
> @@ -730,10 +730,10 @@
>     s->get_resolution((VGAState *)s, &width, &height);
>
>     /* extra x, y */
> -    sx = (src % (width * depth)) / depth;
> -    sy = (src / (width * depth));
> -    dx = (dst % (width *depth)) / depth;
> -    dy = (dst / (width * depth));
> +    sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
> +    sy = (src / ABS(s->cirrus_blt_srcpitch));
> +    dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
> +    dy = (dst / ABS(s->cirrus_blt_dstpitch));
>
>     /* normalize width */
>     w /= depth;


[-- Attachment #2: Type: text/html, Size: 2235 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Fix hardware accelerated video to video copy on Cirrus VGA
  2009-02-15  4:50 [Qemu-devel] [PATCH] Fix hardware accelerated video to video copy on Cirrus VGA Brian Kress
  2009-02-15  5:23   ` C.W. Betts
@ 2009-02-16 14:59 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2009-02-16 14:59 UTC (permalink / raw)
  To: qemu-devel

Brian Kress wrote:
>    cirrus_do_copy() in hw/cirrus_vga.c seems to make some incorrect 
> assumptions about video
> memory layout.  It tries to convert addresses to coordinates assuming 
> that one row of data is
> (width * depth) bytes long.  The correct way seems to be to use the 
> pitch fields in the
> CirrusVGAState structure instead.
>    Without this patch, I get lots of screen corruption when I try to 
> drag a window under X as it's
> passing the wrong coordinates to the display surface for the copy.  
> With this patch I can drag a
> window with no screen corruption.

Applied.  Thanks.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-16 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-15  4:50 [Qemu-devel] [PATCH] Fix hardware accelerated video to video copy on Cirrus VGA Brian Kress
2009-02-15  5:23 ` C.W. Betts
2009-02-15  5:23   ` C.W. Betts
2009-02-16 14:59 ` Anthony Liguori

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.