Bug 58843

Summary: [945 lvds downclock] Very slow redraw performance
Product: DRI Reporter: Alexander Lam <lambchop468>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: florian
Version: unspecified   
Hardware: x86 (IA32)   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch to manually specify dotclock
none
xorg.log
none
logverbose=7 xorg log
none
gem_gtt_speed results, latest rc kernel & latest stable ddx
none
gem_gtt_speed results, latest rc kernel & latest stable ddx (typo fixed)
none
dmesg with lvds downclock dotclock=25500 kHz
none
Only signal CRTC idle from the device idle
none
patch for kernel 3.8rc1
none
Results of gem_gtt_speed with patch none

Description Alexander Lam 2012-12-28 21:52:18 UTC
Created attachment 72230 [details]
Patch to manually specify dotclock

With LVDS downclock enabled, redraw for some applications slows down a lot.

Symptoms:
urxvt: very slow - I can see each character being drawn onto the screen
glxgears: running with vblank_mode=0, glxgears runs at about 22.5 FPS. If the window is hidden (I do not use a compositing window manager), glxgears runs at 315 fps or so.
youtube: In Firefox, playing a video with Adobe Flash, and drm.debug=0x2, I can see that lvds upclock does not happen for frame updates of the video - lvds is downclocked for continuous periods of time on the order of seconds (expected behavior?)
openbox: window decorations draw slowly

Everything was fine for kernel 3.4.9. I upgraded today to 3.7.1 and all of these showed up. I highly suspect [1], combined with reclocking LVDS taking too long. I can do a bisect upon request.

My panel doesn't actually advertise lower refresh rates through EDID, so I patched my kernel to let me manually specify a dotclock (patch attached).

I am using SNA. The same symptoms occur on UXA.

Software:
xf86-video-intel: 2.20.5
xserver: 1.12.4
libdrm: 2.4.38
mesa: 8.0.4
kernel: 3.7.1

Hardware:
Acer Aspire One (ZG5/AOA150) - Intel 945GSE


[1] http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff;h=f047e395ddc9da6c307a10629a237502e627ed85;hp=a7b9761d0a2ded58170ffb4d423ff3d7228103f4
Comment 1 Alexander Lam 2012-12-28 21:53:23 UTC
Created attachment 72231 [details]
xorg.log
Comment 2 Chris Wilson 2012-12-28 22:34:19 UTC
(In reply to comment #0)
> Symptoms:
> urxvt: very slow - I can see each character being drawn onto the screen
>
> glxgears: running with vblank_mode=0, glxgears runs at about 22.5 FPS.
>
> youtube: In Firefox, playing a video with Adobe Flash, and drm.debug=0x2, I
> can see that lvds upclock does not happen for frame updates of the video -
> lvds is downclocked for continuous periods of time on the order of seconds
> (expected behavior?)

This can be expected as we have never marked the fb as busy if the scanout is accessed via the GTT mapping (which is how the swrast in flash will eventually be updated). 

The only thing that can be attributed to lvds downclocking here is the vblank limited glxgears. The 2D engine should not be rate limited by the vrefresh frequency - something else is broken.

Your dmesg and a full-debug Xorg log would be useful.
Comment 3 Alexander Lam 2012-12-28 22:54:18 UTC
Created attachment 72232 [details]
logverbose=7 xorg log
Comment 4 Chris Wilson 2012-12-28 23:00:51 UTC
(In reply to comment #3)
> Created attachment 72232 [details]
> logverbose=7 xorg log

Sorry, what I meant was compile the ddx with --enable-debug=full and use sna, and capture a log of using urxvt. Also see if anything shows up on top and perf top when urxvt is being very slow.

And dmesg :)
Comment 5 Chris Wilson 2012-12-28 23:03:50 UTC
I think another useful piece of evidence with be intel-gpu-tools/tests/gem_gtt_speed.
Comment 6 Alexander Lam 2012-12-28 23:11:56 UTC
Yeah, I'm going to have to hold off - I am currently updating my system from software versions from August 2012 to now (archlinux rolling release - it's sometimes a pain). Until then I can't install new packages because of dependency issues. I'll be back soon.
Comment 7 Chris Wilson 2012-12-30 10:22:19 UTC
In the meantime, can you please grab intel-gpu-tools (http://cgit.freedesktop.org/xorg/app/intel-gpu-tools) and paste the output of i-g-t/tests/gem_gtt_speed?
Comment 8 Alexander Lam 2012-12-30 20:49:52 UTC
Created attachment 72312 [details]
gem_gtt_speed results, latest rc kernel & latest stable ddx

the rest of the stuff you requested will be up within the hour
Comment 9 Alexander Lam 2012-12-30 20:51:06 UTC
Created attachment 72313 [details]
gem_gtt_speed results, latest rc kernel & latest stable ddx (typo fixed)

Oops, I labeled both sets of results as LVDS downclocking enabled.
Comment 10 Chris Wilson 2012-12-30 21:00:25 UTC
Short answer don't do that, you're hurting your hardware. How about a drm.debug=6 dmesg to verify that you are selecting sane values?
Comment 11 Alexander Lam 2012-12-30 21:09:07 UTC
Created attachment 72314 [details]
dmesg with lvds downclock dotclock=25500 kHz
Comment 12 Chris Wilson 2012-12-30 21:33:22 UTC
Created attachment 72315 [details] [review]
Only signal CRTC idle from the device idle
Comment 13 Alexander Lam 2012-12-30 22:04:43 UTC
Created attachment 72316 [details] [review]
patch for kernel 3.8rc1

Yes, that fixes it.
I've attached the patch I used on 3.8rc1. There was one rename and one removal of a line that wasn't needed.

Thanks!
Comment 14 Alexander Lam 2012-12-30 22:08:56 UTC
Created attachment 72317 [details]
Results of gem_gtt_speed with patch
Comment 15 Chris Wilson 2013-01-08 09:29:08 UTC
Daniel please take a look at the attached patch, good enough?
Comment 16 Chris Wilson 2013-01-30 17:47:29 UTC
commit cf5199e4092500056bcfac7eae76a17433a6c22f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jan 8 11:02:57 2013 +0000

    drm/i915: Only run idle processing from i915_gem_retire_requests_worker

Flagged for stable, but will only be backported from 3.9...
Comment 17 Florian Mickler 2013-03-04 22:56:31 UTC
A patch referencing this bug report has been merged in Linux v3.9-rc1:

commit 725a5b54028916cd2511a251c5b5b13d1715addc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jan 8 11:02:57 2013 +0000

    drm/i915: Only run idle processing from i915_gem_retire_requests_worker

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.