Bug 29951

Summary: [r300g] xscreensaver hack "antspotlight" reveals something other than desktop
Product: Mesa Reporter: Chris Rankin <rankincj>
Component: Drivers/Gallium/r300Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED NOTOURBUG QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: What the ant saw...

Description Chris Rankin 2010-09-01 14:45:03 UTC
Created attachment 38368 [details]
What the ant saw...

The xscreensaver hack "antspotlight" is supposed to depict an ant with a spotlight on its head wandering over your desktop in the dark. The idea is that the ant reveals little patches of your desktop as it wanders around.

With r300g and my RV350, the ant is most definitely not revealing my desktop. (Not this time, anyway. It seems to be random.)
Comment 1 Marek Olšák 2010-09-15 07:38:14 UTC
The screensaver shows my wallpaper gallery rather than my desktop, but the images look all right here.
Comment 2 Chris Rankin 2010-09-15 07:50:00 UTC
(In reply to comment #1)
> The screensaver shows my wallpaper gallery rather than my desktop, but the
> images look all right here.

The choice of image looks random to me. Try running another OpenGL application, and then rerunning the screensaver. I tried reproducing this bug last night and at first I thought it was fixed. But then I played WoW for a bit and tried again...
Comment 3 Michel Dänzer 2010-09-15 10:17:18 UTC
(In reply to comment #1)
> The screensaver shows my wallpaper gallery rather than my desktop, [...]

This depends on the 'Image Manipulation' settings on the 'Advanced' tab of xscreensaver-demo.
Comment 4 Marek Olšák 2011-02-10 17:41:39 UTC
Is this issue still present with the current Mesa master branch?
Comment 5 Chris Rankin 2011-02-12 11:27:32 UTC
(In reply to comment #4)
> Is this issue still present with the current Mesa master branch?

Unfortunately, yes. Although it does seem to happen a lot less often now.
Comment 6 Tom Stellard 2011-09-18 18:18:07 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Is this issue still present with the current Mesa master branch?
> 
> Unfortunately, yes. Although it does seem to happen a lot less often now.

I just tested this with the latest version from git, and it appears to be working.  Can you confirm this?
Comment 7 Chris Rankin 2011-09-19 01:29:22 UTC
(In reply to comment #6)
> I just tested this with the latest version from git, and it appears to be
> working.  Can you confirm this?

Sorry, it's not fixed yet. I ran antspotlight about 5 times in succession and the problem reoccurred. It did work the first few times, though.
Comment 8 Tom Stellard 2011-09-22 16:04:28 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > I just tested this with the latest version from git, and it appears to be
> > working.  Can you confirm this?
> 
> Sorry, it's not fixed yet. I ran antspotlight about 5 times in succession and
> the problem reoccurred. It did work the first few times, though.


Does it work with llvmpipe?
Comment 9 Chris Rankin 2011-09-23 02:54:54 UTC
(In reply to comment #8)
> Does it work with llvmpipe?

It works with LIBGL_ALWAYS_SOFTWARE=1, if that's what you mean.
Comment 10 pmarques 2011-09-23 04:10:57 UTC
Doesn't this seem to be some sort of race condition?

The screensaver needs to do a "screenshot" to display on the floor. If it captures the screenshot too late, it gets its own image instead of the desktop image...
Comment 11 Chris Rankin 2011-09-23 04:21:21 UTC
(In reply to comment #10)
> Doesn't this seem to be some sort of race condition?
> 
> The screensaver needs to do a "screenshot" to display on the floor. If it
> captures the screenshot too late, it gets its own image instead of the desktop
> image...

It works with both the r600g (faster than r300g) and swrast (slower than r300g) drivers, though. So whatever the problem is, it does appear to be with the r300g driver.
Comment 12 Tom Stellard 2011-09-25 17:52:53 UTC
Would you be able to post an apitrace(https://github.com/apitrace/apitrace)?
Comment 13 Chris Rankin 2011-09-28 04:06:58 UTC
(In reply to comment #12)
> Would you be able to post an apitrace(https://github.com/apitrace/apitrace)?

I have created two apitraces, one for antspotlight working correctly and the other for antspotlight not working. (It was more difficult to get antspotlight to misbehave with apitrace installed, but obviously not impossible).

Unfortunately, the files are far too big to attach here, even after bzip2:

 4726693 Sep 28 11:54 antspotlight-good.trace.bz2
10403215 Sep 28 11:57 antspotlight-bad.trace.bz2

Can I send them to your private email address instead, please?
Comment 14 Tom Stellard 2011-09-28 05:20:41 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > Would you be able to post an apitrace(https://github.com/apitrace/apitrace)?
> 
> I have created two apitraces, one for antspotlight working correctly and the
> other for antspotlight not working. (It was more difficult to get antspotlight
> to misbehave with apitrace installed, but obviously not impossible).
> 
> Unfortunately, the files are far too big to attach here, even after bzip2:
> 
>  4726693 Sep 28 11:54 antspotlight-good.trace.bz2
> 10403215 Sep 28 11:57 antspotlight-bad.trace.bz2
> 
> Can I send them to your private email address instead, please?

Sure, no problem.
Comment 15 Tom Stellard 2011-09-28 22:15:41 UTC
I ran the bad apitrace you sent me, and it looked the same on r300g and llvmpipe.  I'm leaning toward this being a bug in xscreensaver, rather than in the driver.  You might want to ask the developers of xscreensaver to take a look, they will probably have a better idea of what is happening.
Comment 16 Michel Dänzer 2011-09-29 00:20:23 UTC
(In reply to comment #13)
> I have created two apitraces, one for antspotlight working correctly and the
> other for antspotlight not working.

When you replay these traces, do you consistently get good results with the 'good' trace and bad results with the 'bad' trace?
Comment 17 Chris Rankin 2011-09-29 02:38:34 UTC
(In reply to comment #16)
> When you replay these traces, do you consistently get good results with the
> 'good' trace and bad results with the 'bad' trace?

Yes. The captured image representing my desktop must be stored within the trace file.
Comment 18 Michel Dänzer 2011-09-29 09:49:41 UTC
(In reply to comment #15)
> I'm leaning toward this being a bug in xscreensaver, rather than in the
> driver.  You might want to ask the developers of xscreensaver to take a
> look, they will probably have a better idea of what is happening.

I tend to agree. I notice that the antspotlight window appears briefly and then disappears again while the desktop contents are grabbed. The way this is done might not guarantee that it can't pick up the contents of the antspotlight window before it disappears.

I've been able to reproduce it with the classic r300 driver as well.
Comment 19 Tom Stellard 2011-10-28 18:29:56 UTC
This appears to be an issue with xscreensaver and not a driver bug.  I recommend notifying the xscreensaver developers.

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.