Re: [PATCH 3/4] sm501: Ignore no-op blits

2020-06-15 Thread BALATON Zoltan

On Mon, 15 Jun 2020, Peter Maydell wrote:

On Sat, 6 Jun 2020 at 20:22, BALATON Zoltan  wrote:


Some guests seem to try source copy blits with same source and dest
which are no-op so avoid calling pixman for these.


Are they doing actual source copy blits, or one of the other
currently-unimplemented op types which we currently fall
back to doing as source-copy ?


I thought the same but in the cases I've seen the rop was 0xcc which is 
copy source so it looks like an actual source copy blit (this seems to be 
an issue in the guest driver, I've notified appropriate people but not 
sure it's still maintained). Even if it was fallback we wouldn't need to 
do the copy in this case as it changes nothing so we can optimise this 
out. When we implement the missing op that would come before this case so 
this is only for source copy case.



Signed-off-by: BALATON Zoltan 

Reviewed-by: Peter Maydell 


Thank you,
BALATON Zoltan



Re: [PATCH 3/4] sm501: Ignore no-op blits

2020-06-15 Thread Peter Maydell
On Sat, 6 Jun 2020 at 20:22, BALATON Zoltan  wrote:
>
> Some guests seem to try source copy blits with same source and dest
> which are no-op so avoid calling pixman for these.

Are they doing actual source copy blits, or one of the other
currently-unimplemented op types which we currently fall
back to doing as source-copy ?

> Signed-off-by: BALATON Zoltan 

thanks
-- PMM



[PATCH 3/4] sm501: Ignore no-op blits

2020-06-06 Thread BALATON Zoltan
Some guests seem to try source copy blits with same source and dest
which are no-op so avoid calling pixman for these.

Signed-off-by: BALATON Zoltan 
---
 hw/display/sm501.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 85d54b598f..3397ca9fbf 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -788,6 +788,11 @@ static void sm501_2d_operation(SM501State *s)
   (rop2_source_is_pattern ?
   " with pattern source" : ""));
 }
+/* Ignore no-op blits, some guests seem to do this */
+if (src_base == dst_base && src_pitch == dst_pitch &&
+src_x == dst_x && src_y == dst_y) {
+break;
+}
 /* Check for overlaps, this could be made more exact */
 uint32_t sb, se, db, de;
 sb = src_base + src_x + src_y * (width + src_pitch);
-- 
2.21.3