[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: qt-copy
From:       Fredrik =?iso-8859-1?q?H=F6glund?= <fredrik () kde ! org>
Date:       2009-02-23 21:39:14
Message-ID: 200902232239.15417.fredrik () kde ! org
[Download RAW message or body]

On Monday 23 February 2009, Andreas Hartmetz wrote:
> Looks like this completely ruins painting performance with graphicssystem 
> raster for me, both on my desktop with Radeon HD 2400 and radeonhd (open 
> source) driver and on my laptop with Intel i845 and the usual Intel driver.
> The symptoms are e.g. choppy scrolling in KHTML and a visible delay when 
> repainting the client area of a tabwidget. Painting issues with transparent 
> GIFs in KHTML are also still there - just for completeness. I was hoping to 
> see those fixed by the patch :)

The patch doesn't fix any regressions, it's about not using a deprecated
function that many drivers (including the Intel one) no longer support.

Qt would still work with those drivers, but it would end up taking a fallback
path that doesn't use shared memory.

With this change, scrolling large windows is noticeably faster for me with
the radeon driver.

> Painting now seems to be slightly slower than with graphicssystem native 
> overall, worse in some cases like in the text widget I'm writing this email.
> I guess we need somebody to tell us what's happening here :)
> The patch description looks sane to me, but I don't really understand X 
> performance and/or driver issues.

I've attached another patch that tweaks the code a bit to avoid ending
up in a problematic code path in the X server. It also changes the code
to not use SHM with smaller updates, since the sync call that follows it
can actually make it slower in that case.

Does this patch fix the problems you are seeing?

Regards,
Fredrik


["qt-copy.diff" (text/x-patch)]

Index: src/gui/painting/qwindowsurface_raster.cpp
===================================================================
--- src/gui/painting/qwindowsurface_raster.cpp	(revision 930259)
+++ src/gui/painting/qwindowsurface_raster.cpp	(working copy)
@@ -228,9 +228,14 @@
 
     QRect br = rgn.boundingRect().translated(offset);
 #ifndef QT_NO_MITSHM
-    if (d_ptr->image->xshmimg) {
+    if (d_ptr->image->xshmimg && (br.width() * br.height() > 65536)) {
         const QImage &src = d->image->image;
         br = br.intersected(src.rect());
+        // Hack to make sure we satisify the PutImage() constraints in the X server,
+        // since the doShmPutImage() route currently forces a migration to system ram.
+        wbr.setX(wbr.x() - br.x());
+        br.setX(0);
+        br.setWidth(src.width());
         XShmPutImage(X11->display, widget->handle(), d_ptr->gc, d_ptr->image->xshmimg,
                      br.x(), br.y(), wbr.x(), wbr.y(), br.width(), br.height(), False);
         XSync(X11->display, False);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic