Bug 11186 - 945 XVideo uses 96% CPU time but old code use <30% when rotated
Summary: 945 XVideo uses 96% CPU time but old code use <30% when rotated
Status: VERIFIED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Eric Anholt
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on: 12243
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-07 03:42 UTC by Barry Scott
Modified: 2007-10-22 19:06 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Barry Scott 2007-06-07 03:42:20 UTC
Use recent git I see Xorg using 96% CPU to show a
basic MPEG2 720x576 that used to use <30% with the
september 2006 modesetting branch driver code.
The movie plays without dropping frames.

This is an improvement of the git code from about
a month ago that use 99% and the movie was playing
slowly and dropping frames.

The hardware is an HP7600U that has a
Intel(R) Pentium(R) D CPU 2.80GHz running
linux 2.6.21 in SMP.

Here is the output of top when rotated:

top - 11:38:00 up 19:34,  1 user,  load average: 2.95, 1.81, 0.86
Tasks:  84 total,   4 running,  80 sleeping,   0 stopped,   0 zombie
Cpu(s):  8.2% us,  1.3% sy,  0.0% ni, 90.1% id,  0.5% wa,  0.0% hi,  0.0% si
Mem:    505924k total,   492204k used,    13720k free,    40596k buffers
Swap:  2097144k total,      616k used,  2096528k free,   275072k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
20885 root       5 -20  283m  15m  12m R 99.2  3.2   3:12.70 Xorg
21031 root      10  -5  108m  23m  12m S 13.9  4.8   0:22.80 player_xine
21037 root      15   0 95240  20m  14m R  2.0  4.1   0:04.18 player_html_gtk
21041 root       5 -10  6484 3408 2672 S  2.0  0.7   0:00.71 player_text_scr
    1 root      15   0  1748  604  520 S  0.0  0.1   0:00.85 init

And here is the same work load when in normal:

top - 11:39:50 up 19:36,  1 user,  load average: 2.21, 1.93, 1.01
Tasks:  84 total,   3 running,  81 sleeping,   0 stopped,   0 zombie
Cpu(s):  8.2% us,  1.3% sy,  0.0% ni, 90.1% id,  0.5% wa,  0.0% hi,  0.0% si
Mem:    505924k total,   491948k used,    13976k free,    40784k buffers
Swap:  2097144k total,      616k used,  2096528k free,   274972k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
21374 root      10  -5  108m  23m  12m S 11.9  4.8   0:01.67 player_xine
21242 root       0 -20  283m  15m  12m S  2.0  3.2   0:02.31 Xorg
    1 root      15   0  1748  604  520 S  0.0  0.1   0:00.85 init
Comment 1 Hamish Moffatt 2007-06-11 16:24:04 UTC
I am seeing this with MythTV when using the bob deinterlacer.

When I modified the source to disabled the Textured Video xv adapter (leaving only the video overlay adapter) the problem went away.
Comment 2 Barry Scott 2007-06-12 02:25:36 UTC
I updated to summary to make it clear that the problem I see if when rotated.

Its interesting that Hamish sees a similar problem in the not rotated case.

I have tested with xine using xv output on textured and using xshm.
Both use the 96% CPU time.
 
Comment 3 Eric Anholt 2007-06-12 10:11:35 UTC
I've pushed some fixes for context switching in the driver, which included the removal of a bad sync wait that had been added to try to work around the context switching problems.  Playing a random video on my disk with mplayer, rotated, I had <10% cpu usage total now.
Comment 4 Wang Zhenyu 2007-06-12 23:13:59 UTC
Eric, with your latest push, when I tried to play a VOB file from DVD movie, after running mplayer for some seconds, it would start to eat cpu to 99% as before. I think we're running into resource race here, that cpu produces more requests waiting space in ring buffer while graphics engine consumes slower than the request. So we wait (loop) too many times. 

I don't have a good idea on how to fix this now, I can think now is that if we start to wait for ring buffer space for new ring request, we should wait for whole or larger length of ring to dry. Or set some ratio value to detect if ring resource is low and need to wait for more space.
Comment 5 Barry Scott 2007-06-13 05:31:24 UTC
With latest git I'm seeing no change in CPU load.
normal rotation is low CPU
and right rotation is very high.
Comment 6 WuNian 2007-09-12 01:17:19 UTC
With the latest 2D driver and xserver source, after I rotate screen to right, I ran mplayer to play mpeg2 video by using xv driver, the cpu usage percent is <30%, so this bug should be gone.

But because of bug #12243, I can not see any video image when using xv driver.
After bug #12243 fixed, we can retest and close this bug.
Comment 7 WuNian 2007-10-22 19:05:27 UTC
Now bug #11243 is fixed and the bug does not exist.


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.