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 11:09:36 -0700 Message-ID: References: <20110324002457.C7976F80E7@kemper.freedesktop.org> <20110324010256.GX3159@radis.liafa.jussieu.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1852949141==" Return-path: Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id E17369E7C8 for ; Thu, 24 Mar 2011 11:09:39 -0700 (PDT) In-Reply-To: <20110324010256.GX3159@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 , Keith Packard Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1852949141== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Thu, 24 Mar 2011 02:02:56 +0100, Julien Cristau wr= ote: > Hi Keith, >=20 > a couple suggestions below from a quick look over these patches. Thanks for your review! > > static void > > intel_vblank_handler(int fd, unsigned int frame, unsigned int tv_sec, > > - unsigned int tv_usec, DRI2FrameEventPtr event) > > + unsigned int tv_usec, void *event) >=20 > This seems to just revert a change from the previous commit? Sadly, yes -- intel_vblank_handler gets stuffed into the event_context.vblank_handler callback slot which uses 'void *' in the function signature. As DRI2FrameEventPtr is a private type, we can't go fix the public drmEventContext type to match. A cleaner patch sequence would have removed the change from both patches. Oops! > > + i830_dri2_add_frame_event(flip_info); > > + >=20 > if (!i830_dri_add_frame_event(flip_info)) > return FALSE; > ? ... > > + i830_dri2_add_frame_event(swap_info); > > + >=20 > if (!i830_dri2_add_frame_event(swap_info) > goto blit_fallback; > ? Good catch. Not quite that easy to fix; the swap_info needs to be freed, and a partial add_frame_event must clean up after itself. diff --git a/src/intel_dri.c b/src/intel_dri.c index 3b80823..f7a4fc4 100644 =2D-- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -625,8 +625,10 @@ i830_dri2_add_frame_event(DRI2FrameEventPtr frame_even= t) if (!AddResource(frame_event->client_id, frame_event_client_type, frame_e= vent)) return FALSE; =20 =2D if (!AddResource(frame_event->drawable_id, frame_event_drawable_type, f= rame_event)) + if (!AddResource(frame_event->drawable_id, frame_event_drawable_type, fra= me_event)) { + FreeResourceByType(frame_event->client_id, frame_event_client_type, TRUE= ); return FALSE; + } =20 return TRUE; } @@ -705,7 +707,10 @@ I830DRI2ScheduleFlip(struct intel_screen_private *inte= l, flip_info->event_data =3D data; flip_info->frame =3D target_msc; =20 =2D i830_dri2_add_frame_event(flip_info); + if (!i830_dri2_add_frame_event(flip_info)) { + free(flip_info); + return FALSE; + } =20 /* Page flip the full screen buffer */ back_priv =3D back->driverPrivate; @@ -958,7 +963,10 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr dra= w, DRI2BufferPtr front, I830DRI2ReferenceBuffer(front); I830DRI2ReferenceBuffer(back); =20 =2D i830_dri2_add_frame_event(swap_info); + if (!i830_dri2_add_frame_event(swap_info)) { + free(swap_info); + goto blit_fallback; + } =20 /* Get current count */ vbl.request.type =3D DRM_VBLANK_RELATIVE; =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iD8DBQFNi4jgQp8BWwlsTdMRAmkvAJ9Zxt73hrhFQfYYe7dNAqZ8y9+DKgCgnhv9 3N4dwgd88AaTU75O4SRXyrU= =cEpN -----END PGP SIGNATURE----- --=-=-=-- --===============1852949141== 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 --===============1852949141==--