All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pauli Nieminen <ext-pauli.nieminen-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
To: xorg-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Application calling DRI2SwapBuffers twice without updating buffers
Date: Mon, 13 Sep 2010 11:57:51 +0300	[thread overview]
Message-ID: <20100913085751.GE26053@squeeze> (raw)

Hi,

It is possible for client to call DRI2SwapBuffers twice in row even tough
client should update back buffer in between. Problem is exposed when
application does stupid thing like:

renderScene();
glXSwapBuffers();
/* Might be long delay between but no rendering */
glXSwapBuffers();

glx and egl specifications don't say anything if driver may fail in this case.
Only relevant part is that the back will hold undefined content. Second swap
will results front buffer holding undefined content. Which makes me think that
specification makes above code application error only that shouldn't be
detected.

Is ddx driver allowed to fail the swap in this case?

There is some special case when application doesn't have any back buffer.
Hardware limitation forces driver to share buffers between applications. Too
bad sharing causes that new application might takes over the back buffer
between swaps.

The special case where there is no valid back for client because client
failed to render between swapbuffers has to fail either silently or with error.
I would prefer to return error that is mostly likely ignored by application.

Should driver fail all swaps that would result to the front buffer to have
completely undefined content?

There could be simple detection for the application trying to show random
content. This would catch a few trivial application errors that would cause
corruption in screen.

Detecting application errors (if it can be done cheaply) would help application
developers understand that their code is causing problems.

If driver is utilising invalidate events detection can't happen in server
side. 

Pauli
_______________________________________________
xorg-devel-go0+a7rfsptAfugRpC6u6w@public.gmane.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

             reply	other threads:[~2010-09-13  8:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13  8:57 Pauli Nieminen [this message]
2010-09-13 16:20 ` Application calling DRI2SwapBuffers twice without updating buffers Jesse Barnes

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=20100913085751.GE26053@squeeze \
    --to=ext-pauli.nieminen-xnzwkgviw5gavxtiumwx3w@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=xorg-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.