From: Eric Anholt Subject: Re: [PATCH] drm/i915: don't queue flips during a flip pending event Date: Thu, 01 Jul 2010 16:09:00 -0700 Message-ID: <878w5uyf3n.fsf@pollan.anholt.net> References: <20100405140831.00892ba7@jbarnes-piketon> <87r5lxooqz.fsf@pollan.anholt.net> <20100503124030.2250fbf8@jbarnes-x201> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0920597839==" Return-path: In-Reply-To: <20100503124030.2250fbf8@jbarnes-x201> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0920597839== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Mon, 3 May 2010 12:40:30 -0700, Jesse Barnes = wrote: > On Thu, 29 Apr 2010 15:52:36 -0700 > Eric Anholt wrote: > > > + if (intel_crtc->plane) > > > + flip_mask =3D > > > I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT; > > > + else > > > + flip_mask =3D > > > I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT; + > > > + /* Wait for any previous flip to finish */ > > > + while (I915_READ(ISR) & flip_mask) > > > + ; > > > + > >=20 > > I'm confused about how this patch works. It looks like there's a race > > where the ISR bit could get set at this point after the loop checking > > it, and you would lose. The whole thing seems very dubious -- why > > does the state of the ISR at the time you queue a flip matter? I > > could imagine there being an issue with the state of the ISR at the > > point that a flip packet is processed, but this doesn't handle that > > (seems like only throttling flips to avoid outstanding flips would) >=20 > [We talked about this in person; this is for posterity] >=20 > We have mutexes and spinlocks in place to make sure only one flip is > queued at once, so checking the ISR should be safe here. >=20 > The reason we need to check is that hw could have queued a previous > flip, and we may even have completed the first half of it (due to the > flip pending interrupt). But until the flip actually completes at > vblank time, queuing another one will be "undefined" according to the > docs. Turns out in this case "undefined" means hangs and other bad > behavior. >=20 > That said, I think this needs an Ironlake check too, since the bits > have moved recently. status update: taking this one off my todo list, since it needs to be updated for ironlake --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkwtIAwACgkQHUdvYGzw6veQdQCdFm7n2g22gEvMH/GOGVgUxLrD X7cAn2w5HsQ1+/REV8KqFt9nahgzUkyO =7KOP -----END PGP SIGNATURE----- --=-=-=-- --===============0920597839== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0920597839==--