Intel driver using 100% of cpu in MythTV bob

Hamish Moffatt hamish at cloud.net.au
Sun Jun 10 08:04:39 PDT 2007


I'm running MythTV with the latest Intel driver on a 945GM adapter.

MythTV has an output deinterlacing algorithm called "bob" which involves 
flipping the visible output area through Xv at the refresh rate (50Hz in my 
case).

When I use this algorithm, the Xorg process uses 100% of one core, and
MythTV can't keep up with the frame rate. If I disable this algorithm
(and use the kerneldeint deinterlacer instead), it works perfectly.

I've run oprofile to track this down:

hamish at moocher:~$ opreport --symbols /usr/lib/xorg/modules/drivers/intel_drv.so
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples  %        symbol name
78307    94.7820  I830WaitLpRing
2438      2.9509  I830PutImage
1809      2.1896  .plt
23        0.0278  I915DisplayVideoTextured
10        0.0121  I830DRISwapContext
9         0.0109  I830EmitFlush
5         0.0061  I830BlockHandler
5         0.0061  I830RefreshRing
5         0.0061  i830MarkSync
5         0.0061  i830_clip_video_helper
2         0.0024  I830QueryImageAttributes

Below I've included the annotated results for the I830WaitLpRing
function.

Myth appears to be using the Textured Video xv adapter for output.

I have reports that this setup works fine for at least one other person
who is using a 32-bit kernel and a 965G adapter. I am running 64-bit and
a 945GM.

I've attached my xorg.conf also.

Any suggestions as to what might cause this? Is it a configuration issue
or a bug?

thanks,
Hamish

/* 
 * Command line: opannotate --source 
 * 
 * Interpretation of command line:
 * Output annotated source file with samples
 * Output all files
 * 
 * CPU: CPU with timer interrupt, speed 0 MHz (estimated)
 * Profiling through timer interrupt
 */
/* 
 * Total samples for file : "/home/hamish/xf86-video-intel/src/i830_accel.c"
 * 
 * 136310 29.5687
 */

               :int
               :I830WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis)
     2 4.3e-04 :{ /* I830WaitLpRing total: 136286 29.5635 */
               :   I830Ptr pI830 = I830PTR(pScrn);
     1 2.2e-04 :   I830RingBuffer *ring = pI830->LpRing;
               :   int iters = 0;
               :   unsigned int start = 0;
               :   unsigned int now = 0;
               :   int last_head = 0;
               :   unsigned int first = 0;
               :
               :   /* If your system hasn't moved the head pointer in 2 seconds, I'm going to
               :    * call it crashed.
               :    */
               :   if (timeout_millis == 0)
               :      timeout_millis = 2000;
               :
               :   if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) {
               :      ErrorF("I830WaitLpRing %d\n", n);
               :      first = GetTimeInMillis();
               :   }
               :
               :   while (ring->space < n) {
     1 2.2e-04 :      ring->head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK;
135096 29.3054 :      ring->space = ring->head - (ring->tail + 8);
               :
               :      if (ring->space < 0)
               :	 ring->space += ring->mem->size;
               :
               :      iters++;
               :      now = GetTimeInMillis();
  1178  0.2555 :      if (start == 0 || now < start || ring->head != last_head) {
               :	 if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
               :	    if (now > start)
               :	       ErrorF("space: %d wanted %d\n", ring->space, n);
               :	 start = now;
     1 2.2e-04 :	 last_head = ring->head;
     7  0.0015 :      } else if (now - start > timeout_millis) {
               :	 ErrorF("Error in I830WaitLpRing(), timeout for %d seconds\n",
               :		timeout_millis/1000);
               :	 if (IS_I965G(pI830))
               :	     i965_dump_error_state(pScrn);
               :	 else
               :	     i830_dump_error_state(pScrn);
               :	 ErrorF("space: %d wanted %d\n", ring->space, n);
               :#ifdef XF86DRI
               :	 if (pI830->directRenderingEnabled) {
               :	    DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
               :	    DRICloseScreen(screenInfo.screens[pScrn->scrnIndex]);
               :	 }
               :#endif
               :#ifdef I830_USE_XAA
               :	 pI830->AccelInfoRec = NULL;	/* Stops recursive behavior */
               :#endif
               :#ifdef I830_USE_EXA
               :	 pI830->EXADriverPtr = NULL;
               :#endif
               :	 FatalError("lockup\n");
               :      }
               :
               :      DELAY(10);
               :   }
               :
               :   if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) {
               :      now = GetTimeInMillis();
               :      if (now - first) {
               :	 ErrorF("Elapsed %u ms\n", now - first);
               :	 ErrorF("space: %d wanted %d\n", ring->space, n);
               :      }
               :   }
               :
               :   return iters;
               :}
-- 
Hamish Moffatt VK3SB <hamish at debian.org> <hamish at cloud.net.au>
-------------- next part --------------
# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
EndSection

Section "InputDevice"
	Identifier	"Generic Keyboard"
	Driver		"kbd"
	Option		"CoreKeyboard"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc104"
	Option		"XkbLayout"	"us"
EndSection

Section "InputDevice"
	Identifier	"Configured Mouse"
	Driver		"mouse"
	Option		"CorePointer"
	Option		"Device"		"/dev/input/mice"
	Option		"Protocol"		"ImPS/2"
	Option		"Emulate3Buttons"	"true"
EndSection

Section "Device"
	Identifier	"Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
	Driver		"intel"
	BusID		"PCI:0:2:0"
	#Option		"DDC" "No"
	Option		"Monitor-TV" "TV"
	Option		"Monitor-VGA" "TV"
	Option "LinearAlloc" "6144"
	Option "ModeDebug" "Yes"
EndSection

Section "Monitor"
	Identifier	"TV"
	#Option		"DPMS"
	DisplaySize     361 202

	#Option 		"TV Format" "1080i at 50Hz"
	#Option 		"TV Format" "720p at 50Hz"
	Option		"PreferredMode" "1280x720x25"

	# Works, needs adjustment:
	#Modeline "1920x720_50.00"  91.29  1920 1992 2192 2464  720 721 724 741  -HSync -Vsync
	#Modeline "1920x720_50.00"  91.29  1920 2032 2232 2464  720 721 724 741  -HSync +Vsync

	# Works, from old machine:
	#Modeline "1280x720x25" 83.700 1280 1780 1828 2176 720 751 754 769 +hsync +vsync
	Modeline "1280x720x25" 83.700 1280 1780 1828 2172 720 751 754 769 +hsync +vsync
	#Modeline "1280x720x25" 83.70565 1280 1780 1828 2177 720 751 754 769 +hsync +vsync

EndSection

Section "Screen"
	Identifier	"Default Screen"
	Device		"Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
	Monitor		"TV"
	DefaultDepth	24
	SubSection "Display"
		Depth		24
		#Modes		"1280x1024"
		Modes		"1024x768"
	EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"Default Layout"
	Screen		"Default Screen"
	InputDevice	"Generic Keyboard"
	InputDevice	"Configured Mouse"
EndSection

Section "Module"
	Disable "XFree86-DRI"
	Disable "DPMS"
EndSection


More information about the xorg mailing list