Bug 27420 - [regression][i965] mesa-7.8 + compiz : windows fail to update properly
Summary: [regression][i965] mesa-7.8 + compiz : windows fail to update properly
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Kristian Høgsberg
QA Contact:
URL:
Whiteboard:
Keywords:
: 27425 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-01 21:12 UTC by Alexandre Rostovtsev
Modified: 2010-05-10 05:52 UTC (History)
9 users (show)

See Also:
i915 platform:
i915 features:


Attachments
screenshot (66.09 KB, image/png)
2010-04-01 21:18 UTC, Alexandre Rostovtsev
Details
Xorg.0.log (17.15 KB, text/plain)
2010-04-01 21:25 UTC, Alexandre Rostovtsev
Details
unconditionally update renderbuffers (628 bytes, patch)
2010-04-30 05:46 UTC, Kshitij Kulshreshtha
Details | Splinter Review
snapshot of character corruption (2.75 KB, image/png)
2010-04-30 05:58 UTC, Kshitij Kulshreshtha
Details

Description Alexandre Rostovtsev 2010-04-01 21:12:40 UTC
With mesa-7.8 and compiz on Intel GM45 hardware, windows fail to update and redraw properly. Typing a piece of text can leave the text field lagging behind your typing by a second. Switching to a different tab in an application will often leave the image of the contents of the old tab in place. Scrolling in a scrollable window will leave parts of the image of the window in the previous scroll position in their old place. Typing a command in a terminal will not result in any visible output until you press "enter" a few times.

Basically, it makes the desktop utterly unusable.

The workaround is to enable the "Fix screen updates in XGL with fglrx" ("fglrx_xgl_fix") option in the compiz workaround plugin. This option disables the use of GLX_MESA_copy_sub_buffer extension, meaning that OpenGL performance drops to the floor: 90 fps in glxgears, desktop framerate when dragging a window is in the single digits, etc. But at least windows redraw properly.

This is a regression since mesa-7.7.x works correctly. I first obeserved this behavior in some 7.8 rc, and it still exists in the latest git checkout from the 7.8 branch.

Software versions:
compiz-0.8.4
xorg-server-1.7.6
kernel 2.6.33.1
libdrm-2.4.19 and git HEAD
xf86-video-intel-2.10.0 and 2.11.0
Comment 1 Alexandre Rostovtsev 2010-04-01 21:18:16 UTC
Created attachment 34607 [details]
screenshot

A screenshot of the chromium preferences dialog demonstrating the effect of this bug.

When I switched from one tab of the dialog to another, the image of the contents of the old tab remained in place. After waving my mouse over the window a bit, some parts of the user interface of the new tab popped up (probably since highlighting them forced a redraw). However, the image of the old UI remained drawn in the background; the result is that the user sees a crazy mixture of the contents of two tabs.
Comment 2 Alexandre Rostovtsev 2010-04-01 21:25:38 UTC
Created attachment 34608 [details]
Xorg.0.log
Comment 3 Kshitij Kulshreshtha 2010-04-06 03:35:57 UTC
This does not seem to be restricted to GM45 as I am seeing this behaviour even on my 915GM.
Comment 4 Raimar Sandner 2010-04-06 11:59:28 UTC
945GM is also affected.
Comment 5 Raimar Sandner 2010-04-06 14:07:26 UTC
The bug is still present in the latest mesa 7.8.1 release.
Comment 6 Kshitij Kulshreshtha 2010-04-06 23:06:49 UTC
Bugs #27421 and #27425 look like they are related to this one. I tested a similar patch as suggested in #27425 comment 4 to call intel_update_renderbuffers() unconditionally in intelSetTexBuffer2(). This helps somewhat, at least windows are update and scrolling text works, but this surely is not the right fix for the bug if I understand the commit messages properly.
Comment 7 Tomas M. 2010-04-29 14:31:20 UTC
downgraded mesa to 7.7.1
downgraded intel to 2.10

xorg = 1.8

issue still present. does this point to an xorg bug?
Comment 8 Kristian Høgsberg 2010-04-29 17:49:26 UTC
(In reply to comment #6)
> Bugs #27421 and #27425 look like they are related to this one. I tested a
> similar patch as suggested in #27425 comment 4 to call
> intel_update_renderbuffers() unconditionally in intelSetTexBuffer2(). This
> helps somewhat, at least windows are update and scrolling text works, but this
> surely is not the right fix for the bug if I understand the commit messages
> properly.

When you say "helps somewhat" do you mean that there are still redraw problems or what are you referring to?  The patch in #27425 is almost right, but if you see corruption even with that applied, can you try the patch in #27767, comment 1.
Comment 9 Raimar Sandner 2010-04-30 00:05:07 UTC
Sorry I am a bit confused, what exactly is the right patch to test? When you say #27425 comment 4 is almost right, is there better patch available?
Comment 10 Tomas M. 2010-04-30 03:39:23 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > Bugs #27421 and #27425 look like they are related to this one. I tested a
> > similar patch as suggested in #27425 comment 4 to call
> > intel_update_renderbuffers() unconditionally in intelSetTexBuffer2(). This
> > helps somewhat, at least windows are update and scrolling text works, but this
> > surely is not the right fix for the bug if I understand the commit messages
> > properly.
> 
> When you say "helps somewhat" do you mean that there are still redraw problems
> or what are you referring to?  The patch in #27425 is almost right, but if you
> see corruption even with that applied, can you try the patch in #27767, comment
> 1.

doing that makes it untestable. everything LAGS!!,

going to test the oter patch on mesa and report back.

my previous statement that the issue was in xorg seems somewhat flawed.

it appeared there, and now im with mesa 7.8 and intel 2.11 but with xorg 1.7. it is still present here too.
Comment 11 Tomas M. 2010-04-30 03:56:39 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > Bugs #27421 and #27425 look like they are related to this one. I tested a
> > similar patch as suggested in #27425 comment 4 to call
> > intel_update_renderbuffers() unconditionally in intelSetTexBuffer2(). This
> > helps somewhat, at least windows are update and scrolling text works, but this
> > surely is not the right fix for the bug if I understand the commit messages
> > properly.
> 
> When you say "helps somewhat" do you mean that there are still redraw problems
> or what are you referring to?  The patch in #27425 is almost right, but if you
> see corruption even with that applied, can you try the patch in #27767, comment
> 1.

tried to apply the patch in #27425 comment 4, but the source onf 7.8.1 is quite different, i cannot apply the patch (and it seems like a variation of that patch has already been applied, but im not that sure).

this is what ive got in the source:

    if (!intelObj)
       return;
 
    if (dPriv->lastStamp != dPriv->dri2.stamp)
       intel_update_renderbuffers(pDRICtx, dPriv);
 
    rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);

    /* If the region isn't set, then intel_update_renderbuffers was unable
Comment 12 Kshitij Kulshreshtha 2010-04-30 05:46:04 UTC
Created attachment 35342 [details] [review]
unconditionally update renderbuffers

This patch applies cleanly on top of Mesa-7.8.1 and there is no more window corruption like in the screenshot above
Comment 13 Kshitij Kulshreshtha 2010-04-30 05:48:34 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > Bugs #27421 and #27425 look like they are related to this one. I tested a
> > similar patch as suggested in #27425 comment 4 to call
> > intel_update_renderbuffers() unconditionally in intelSetTexBuffer2(). This
> > helps somewhat, at least windows are update and scrolling text works, but this
> > surely is not the right fix for the bug if I understand the commit messages
> > properly.
> 
> When you say "helps somewhat" do you mean that there are still redraw problems
> or what are you referring to?  The patch in #27425 is almost right, but if you
> see corruption even with that applied, can you try the patch in #27767, comment
> 1.

I say somewhat as I am also seeing some text corruption in xterm it I type very quickly even after applying the above patch. I'll attach a screenshot. Window corruption in gtk as in the screenshot above is gone.
Comment 14 Kshitij Kulshreshtha 2010-04-30 05:58:28 UTC
Created attachment 35343 [details]
snapshot of character corruption

This is what happens when I type. The corruption disappears as soon as I switch windows or do anything that requires a repaint of the window.
Comment 15 Kshitij Kulshreshtha 2010-04-30 06:44:43 UTC
(In reply to comment #8)
> The patch in #27425 is almost right, but if you see corruption even with that 
> applied, can you try the patch in #27767, comment 1.

unfortunately the patch in bug 27767 comment 1 does not apply on xorg-server-1.8.0, which is what I used to test my patch in comment 12. The commit 1da1f33f mentioned in bug 27767 had not been backported to server-1.8-branch until after the 1.8.0 release.
Comment 16 Raimar Sandner 2010-05-01 09:21:14 UTC
The corruptions in individual windows as seen in the screenshot indeed disappear with the patch from comment 12 applied to mesa.

But now there are situations when the hole screen does not update. When this happens and I try to move a window, I now that the window was moved because the mouse cursor changes reflect the actual position of the window (for example on hyperlinks). But the screen does not update and the window is still displayed in its old position.

Changing the virtual desktop then triggers a screen update. I can also confirm the xterm problem.

I tried the patches from bug #27767 with the latest git checkout of the server, but they don't help with this problem.
Comment 17 Emeric Grange 2010-05-01 10:10:22 UTC
Hi !

I think I have the same problem of screen corruption.

I solved it using "indirect rendering" with compiz fusion icon.
Did you tried that ?
Comment 18 Raimar Sandner 2010-05-01 11:56:04 UTC
Starting compiz with --inderect-rendering makes no difference. In fact the problem seems not to be specific to compiz, it also happens with kwin and compositing enabled. kwin without desktop effects is fine.
Comment 19 Kshitij Kulshreshtha 2010-05-02 06:38:05 UTC
(In reply to comment #18)
> Starting compiz with --inderect-rendering makes no difference. In fact the
> problem seems not to be specific to compiz, it also happens with kwin and
> compositing enabled. kwin without desktop effects is fine.

I do not see any problem in kwin (not even the xterm problem) with compositing enabled after using the mesa patch from comment 12. Compiz Window movement is also fine.
Comment 20 Raimar Sandner 2010-05-02 07:51:11 UTC
You are right. The window movement bug is probably unrelated to this bug. I encountered it with xorg-server-1.8.0 and cannot reproduce it with xorg-server-1.7.6 right now. I will test 1.8.0 once again later.

So the patch from comment #12 indeed fixes this bug.
Comment 21 Raimar Sandner 2010-05-02 07:53:15 UTC
Well, apart from the xterm corruptions of course... but it is a great improvement.
Comment 22 Kristian Høgsberg 2010-05-04 10:37:33 UTC
Fix pushed to mesa master, closing bug.
Comment 23 Kristian Høgsberg 2010-05-10 05:52:27 UTC
*** Bug 27425 has been marked as a duplicate of this bug. ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.