Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: Julien Cristau <jcristau@debian.org>
Cc: Keith Packard <keithp@kemper.freedesktop.org>,
	intel-gfx@lists.freedesktop.org
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	[thread overview]
Message-ID: <yunwrjors92.fsf@aiko.keithp.com> (raw)
In-Reply-To: <20110324183103.GF3159@radis.liafa.jussieu.fr>


[-- Attachment #1.1: Type: text/plain, Size: 917 bytes --]

On Thu, 24 Mar 2011 19:31:03 +0100, Julien Cristau <jcristau@debian.org> wrote:

> 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 draw, DRI2BufferPtr front,
        swap_info->event_data = data;
        swap_info->front = front;
        swap_info->back = back;
+
+       if (!i830_dri2_add_frame_event(swap_info)) {
+           free(swap_info);
+           swap_info = NULL;
+           goto blit_fallback;
+       }
+
        I830DRI2ReferenceBuffer(front);
        I830DRI2ReferenceBuffer(back);
 
-       i830_dri2_add_frame_event(swap_info);
-
        /* Get current count */
        vbl.request.type = DRM_VBLANK_RELATIVE;
        if (pipe > 0)

-- 
keith.packard@intel.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2011-03-24 23:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110324002457.C7976F80E7@kemper.freedesktop.org>
2011-03-24  1:02 ` xf86-video-intel: 3 commits - src/intel_display.c src/intel_dri.c src/intel.h Julien Cristau
2011-03-24 18:09   ` Keith Packard
2011-03-24 18:31     ` Julien Cristau
2011-03-24 23:52       ` Keith Packard [this message]
2011-03-24 23:57         ` Julien Cristau
2011-03-25  0:14           ` Keith Packard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yunwrjors92.fsf@aiko.keithp.com \
    --to=keithp@keithp.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jcristau@debian.org \
    --cc=keithp@kemper.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox