From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Packard Subject: Re: xf86-video-intel: 3 commits - src/intel_display.c src/intel_dri.c src/intel.h Date: Thu, 24 Mar 2011 16:52:25 -0700 Message-ID: References: <20110324002457.C7976F80E7@kemper.freedesktop.org> <20110324010256.GX3159@radis.liafa.jussieu.fr> <20110324183103.GF3159@radis.liafa.jussieu.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0583176115==" Return-path: Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 3FC719E709 for ; Thu, 24 Mar 2011 16:52:38 -0700 (PDT) In-Reply-To: <20110324183103.GF3159@radis.liafa.jussieu.fr> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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: Julien Cristau Cc: Keith Packard , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0583176115== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Thu, 24 Mar 2011 19:31:03 +0100, Julien Cristau wr= ote: > This will cause a double free as the blit_fallback path does it too. Argh! So we need to check before we reference the buffers and set swap_info to NULL. This code is too twisty... @@ -955,11 +960,16 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr dr= aw, DRI2BufferPtr front, swap_info->event_data =3D data; swap_info->front =3D front; swap_info->back =3D back; + + if (!i830_dri2_add_frame_event(swap_info)) { + free(swap_info); + swap_info =3D NULL; + goto blit_fallback; + } + I830DRI2ReferenceBuffer(front); I830DRI2ReferenceBuffer(back); =20 =2D i830_dri2_add_frame_event(swap_info); =2D /* Get current count */ vbl.request.type =3D DRM_VBLANK_RELATIVE; if (pipe > 0) =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iD8DBQFNi9k5Qp8BWwlsTdMRArGnAJ9eqkovrQKJI8zx2wX85pgMDpzGGwCeK/G6 lwJllxdjxIqVHuqgdTGpOH8= =ekMH -----END PGP SIGNATURE----- --=-=-=-- --===============0583176115== 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 --===============0583176115==--