From: Michel =?ISO-8859-1?Q?D=E4nzer?= Subject: Re: Flickering screen in Neverball on drm-radeon-testing Date: Fri, 04 Jun 2010 19:27:35 +0200 Message-ID: <1275672455.5860.206.camel@thor.local> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-CO4odU7UcKyeDFiYNm9r" Return-path: Received: from mail.gna.ch (darkcity.gna.ch [195.226.6.51]) by gabe.freedesktop.org (Postfix) with ESMTP id 8FBC79E88C for ; Fri, 4 Jun 2010 10:27:45 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Mario Kleiner Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --=-CO4odU7UcKyeDFiYNm9r Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mit, 2010-06-02 at 16:38 +0200, Mario Kleiner wrote:=20 > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Tue, 1 Jun 2010 12:25:42 -0700 (PDT) > > From: bugzilla-daemon@freedesktop.org > > Subject: [Bug 28341] Flickering screen in Neverball on > > drm-radeon-testing > > To: dri-devel@lists.freedesktop.org > > Message-ID: <20100601192542.ACE5B1300E8@annarchy.freedesktop.org> > > Content-Type: text/plain; charset=3D"UTF-8" > > > > https://bugs.freedesktop.org/show_bug.cgi?id=3D28341 > > > > --- Comment #3 from Magnus Jensen =20 > > 2010-06-01 12:25:42 PDT --- > > Sorry. ignore my last attachment. These errors continue to spawn =20 > > and i don't > > think they are related to neverball. i'm going to recompile mesa =20 > > and ddx, and > > post another dmesg soon. > > Just waiting for a kernel compile to finish. > > >=20 > I saw a similar flickering with latest Xorg stack (mesa master, =20 > xserver, ddx etc. master) and the 2.6.34 tree from radeon testing =20 > with my own toolkit on a R600 gpu. This setup uses the new dri sync & = =20 > swap bits and changes how glXSwapbuffers works. >=20 > My best hunch would be that submission of new rendering commands by =20 > the direct rendering client to the gpu doesn't block after a =20 > glXSwapbuffers() call until the bufferswap completed, i.e., some =20 > synchronization is missing there. >=20 > This shows flickering, but load and timing dependent... >=20 > .... glXXX rendering commands to draw image. > glXSwapBuffers(); > glBegin(GL_POINTS); > glVertex2i(10,10); > glEnd(); > glFinish(); > Take a swap completion timestamp here. > glClear(); > ...more rendering commands >=20 > -> I use this glVertex2i, .... glFinish() sequence to wait for swap =20 > completion and get a timestamp. This works on any os/gpu combo ever =20 > tested, but doesn't seem to work reliably anymore with the new radeon = =20 > sync & swap bits in place. Display flickers, presumably because the =20 > glClear() executes almost immediately after the glXSwapBuffers is =20 > scheduled, and before the bufferswap has actually taken place -> =20 > Clear the backbuffer before swapping. >=20 > This however: >=20 > .... glXXX rendering commands to draw image. > glXSwapBuffers(); > glXWaitForSbcOML(...); > glClear(); > ... >=20 > does work, because the new glXWaitForSbcOML() blocks the client until = =20 > swap completion, so glClear() can only get submitted to the gpu after = =20 > the swap completed. >=20 > [Except that glXWaitForSbcOML itself currently has a bug, for which =20 > i'll send a patch for xorg master/1.8.1 soon]. >=20 > Didn't do detailed testing, but maybe this points into the right =20 > direction? I think your analysis is spot on. The ideal solution would probably be to make the kernel block in the command stream (CS) submission ioctl if the CS renders to (and from?) a buffer object (BO) which is involved in a pending swap. Meanwhile, the attached hacks for xf86-video-ati and Mesa seem to help here, YMMV. --=20 Earthling Michel D=C3=A4nzer | http://www.vmware.c= om Libre software enthusiast | Debian, X and DRI developer --=-CO4odU7UcKyeDFiYNm9r Content-Disposition: attachment; filename="dri2-flicker-mesa.diff" Content-Type: text/x-patch; name="dri2-flicker-mesa.diff"; charset="UTF-8" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9nbHgvZHJpMl9nbHguYyBiL3NyYy9nbHgvZHJpMl9nbHguYw0KaW5k ZXggOGE1YWFhNC4uZTA1OTZiZSAxMDA2NDQNCi0tLSBhL3NyYy9nbHgvZHJpMl9nbHguYw0KKysr IGIvc3JjL2dseC9kcmkyX2dseC5jDQpAQCAtNDU3LDYgKzQ1NywxMCBAQCBkcmkyU3dhcEJ1ZmZl cnMoX19HTFhEUklkcmF3YWJsZSAqcGRyYXcsIGludDY0X3QgdGFyZ2V0X21zYywgaW50NjRfdCBk aXZpc29yLA0KICNpZmRlZiBYX0RSSTJTd2FwQnVmZmVycw0KICAgICBEUkkyU3dhcEJ1ZmZlcnMo cGRyYXctPnBzYy0+ZHB5LCBwZHJhdy0+eERyYXdhYmxlLCB0YXJnZXRfbXNjLCBkaXZpc29yLA0K IAkJICAgIHJlbWFpbmRlciwgJnJldCk7DQorDQorICAgIC8qIE1ha2Ugc3VyZSB3ZSBjYWxsIHRv IHRoZSBzZXJ2ZXIgYmVmb3JlIHJlbmRlcmluZyBhZ2FpbiwgaW4gY2FzZSB3ZSBuZWVkDQorICAg ICAqIHRvIGJsb2NrIGZvciB0aGUgc3dhcCAqLw0KKyAgICBkcmkySW52YWxpZGF0ZUJ1ZmZlcnMo ZHB5UHJpdi0+ZHB5LCBwZHJhdy0+ZHJhd2FibGUpOw0KICNlbmRpZg0KIA0KICAgICByZXR1cm4g cmV0Ow0K --=-CO4odU7UcKyeDFiYNm9r Content-Disposition: attachment; filename="dri2-flicker-xf86-video-ati.diff" Content-Type: text/x-patch; name="dri2-flicker-xf86-video-ati.diff"; charset="UTF-8" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9yYWRlb25fZHJpMi5jIGIvc3JjL3JhZGVvbl9kcmkyLmMNCmluZGV4 IDBlY2RjZDQuLjMwNGE2MWQgMTAwNjQ0DQotLS0gYS9zcmMvcmFkZW9uX2RyaTIuYw0KKysrIGIv c3JjL3JhZGVvbl9kcmkyLmMNCkBAIC03MzYsNiArNzM2LDcgQEAgc3RhdGljIGludCByYWRlb25f ZHJpMl9zY2hlZHVsZV9zd2FwKENsaWVudFB0ciBjbGllbnQsIERyYXdhYmxlUHRyIGRyYXcsDQog ICAgICp0YXJnZXRfbXNjID0gdmJsLnJlcGx5LnNlcXVlbmNlICsgZmxpcDsNCiAgICAgc3dhcF9p bmZvLT5mcmFtZSA9ICp0YXJnZXRfbXNjOw0KIA0KKyAgICBEUkkyQmxvY2tDbGllbnQoY2xpZW50 LCBkcmF3KTsNCiAgICAgcmV0dXJuIFRSVUU7DQogDQogYmxpdF9mYWxsYmFjazoNCg== --=-CO4odU7UcKyeDFiYNm9r Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --=-CO4odU7UcKyeDFiYNm9r--