915gm/945gm/XAA lockup playing Xv video a second time (after mode-switch)
Keith Packard
keithp at keithp.com
Mon Oct 15 06:04:30 PDT 2007
On Mon, 2007-10-15 at 10:11 +0800, Zhenyu Wang wrote:
> On 2007.10.12 15:23:23 +0000, Jesse Barnes wrote:
> > On Friday, October 12, 2007 12:18 pm Peter Clifton wrote:
> > > The following seems to fix it for me by forcing a reset of the Xv
> > > regs after a mode-switch (Does the reset to VT1 clears them?),
> >
> > Yeah, Enter/LeaveVT touch all sorts of regs.
> >
> > > however I'm not sure whether it is a "fix" or a "workaround":
> > >
> > > --- xserver-xorg-video-intel-2.1.1.bwh.pcjc2.orig/src/i830_video.c
> > > 2007-10-11 17:31:01.000000000 +0100 +++
> > > xserver-xorg-video-intel-2.1.1.bwh.pcjc2/src/i830_video.c
> > > 2007-10-11 17:31:01.000000000 +0100 @@ -2927,6 +2927,7 @@
> > > */
> > > I830StopVideo(pScrn, pPriv, TRUE);
> > > pPriv->overlayOK = FALSE;
> > > + pPriv->current_crtc = ULL;
> > > pPriv->oneLineMode = FALSE;
> > > }
> > > }
I think this is wrong -- it should cause the overlay to not get
displayed on the CRTC when the crtc is re-enabled. Of course, you
probably don't notice as the next frame will re-enable it. Testing with
my 'xvtest' program will expose precisely what the original and new code
does in this case.
git://people.freedesktop.org/~keithp/xvtest
hmm. The I830StopVideo call is about to free the video image, so there
won't be any way we can redisplay it without getting it back from the
client. I'm not sure we really care though; we lose the video data in
lots of ways, and discarding the video buffer on mode switch eliminates
a pinned buffer that will (eventually) cause us pains when we resize the
frame buffer.
So, perhaps this fix is close to what we want after all. However, you'll
note that the call to i830_overlay_switch_to_crtc will *never happen*
anymore as pPriv->current_crtc will always be NULL in the (on) case.
That would make this equivalent:
diff --git a/src/i830_video.c b/src/i830_video.c
index beec03e..17a9dd9 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2835,15 +2835,14 @@ i830_crtc_dpms_video(xf86CrtcPtr crtc, Bool on)
if (crtc != pPriv->current_crtc)
return;
- /* Check if it's the crtc the overlay is on */
- if (on) {
- i830_overlay_switch_to_crtc (pScrn, crtc);
- } else {
+ /* Check if it's the crtc the overlay is off */
+ if (!on) {
/* We stop the video when mode switching, so we don't lock up
* the engine. The overlayOK will determine whether we can
re-enable
* with the current video on completion of the mode switch.
*/
I830StopVideo(pScrn, pPriv, TRUE);
+ pPriv->current_crtc = NULL;
pPriv->overlayOK = FALSE;
pPriv->oneLineMode = FALSE;
}
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20071015/0a245da7/attachment.pgp>
More information about the xorg
mailing list