History log of /external/mesa3d/src/glx/dri3_priv.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
13faddb6b8e30ff0e81e62fb863304a57c712aae 30-May-2016 Emil Velikov <emil.velikov@collabora.com> mesa_glinterop: remove mesa_glinterop typedefs

As is there are two places that do the typedefs - dri_interface.h and
this header. As we cannot include the former in here, just drop the
typedefs and use the struct directly (as needed).

This is required because typedef redefinition is C11 feature which is
not supported on all the versions of GCC used to build mesa.

v2: Kill the typedef alltogether, as per Marek.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96236
Cc: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
/external/mesa3d/src/glx/dri3_priv.h
e384d75b120ce60954c545e8c6edbe98fd01bea7 21-Apr-2016 Emil Velikov <emil.velikov@collabora.com> mesa_glinterop: make GL interop version field bidirectional

This allows clear and easy communication between the two.

Caller: Requesting information (struct vN)
Callee: I know how to deal with older version (vN-1) only. Here is your
data and the version I support.
Caller: Older version ? Sure I'll cap all access to the fields provided
by the older version (vN-1)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/glx/dri3_priv.h
37d3a26bd620703f63673101f4093d13fb97ddef 03-Mar-2016 Marek Olšák <marek.olsak@amd.com> glx: implement GLX part of interop interface (v2)

v2: - use const
/external/mesa3d/src/glx/dri3_priv.h
fdacbc439edc1d26865a99524d1a9efc9edb4c0d 21-Jul-2015 Boyan Ding <boyan.j.ding@gmail.com> glx/dri3: Convert to use dri3 helper in loader library

v2: From Martin Peres
- convert to the new drawable interface
- delete dead code after the dropping of some vfuncs
- delete the width and height attributes since they are found in the helper

Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.co.uk>
/external/mesa3d/src/glx/dri3_priv.h
ad8b0e8bf68850a57daba0b47629ca14807ea3ad 05-Dec-2014 Mario Kleiner <mario.kleiner.de@gmail.com> glx/dri3: Track separate (ust, msc) for PresentPixmap vs. PresentNotifyMsc (v2)

Prevent calls to glXGetSyncValuesOML() and glXWaitForMscOML()
from overwriting the (ust,msc) values of the last successfull
swapbuffers call (PresentPixmapCompleteNotify event), as
glXWaitForSbcOML() relies on those values corresponding to
the most recent completed swap, not to whatever was last
returned from the server.

Problematic call sequence without this patch would have been, e.g.,

glXSwapBuffers()
... wait ...
swap completes -> PresentPixmapComplete event -> (ust,msc)
updated to reflect swap completion time and count.
... wait for at least 1 video refresh cycle/vblank increment.

glXGetSyncValuesOML()
-> PresentNotifyMsc event overwrites (ust,msc) of swap
completion with (ust,msc) of most recent vblank

glXWaitForSbcOML()
-> Returns sbc of last completed swap but (ust,msc) of last
completed vblank, not of last completed swap.
-> Client is confused.

Do this by tracking a separate set of (ust, msc) for the
dri3_wait_for_msc() call than for the dri3_wait_for_sbc()
call.

This makes the glXWaitForSbcOML() call robust again and restores
consistent behaviour with the DRI2 implementation.

Fixes applications originally written and tested against
DRI2 which also rely on this not regressing under DRI3/Present,
e.g., Neuro-Science software like Psychtoolbox-3.

This patch fixes the problem.

v2: Rename vblank_msc/ust to notify_msc/ust as suggested by
Axel Davy for better clarity.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
/external/mesa3d/src/glx/dri3_priv.h
26122e09a304061e46690e1b9da2e36a527b3e2e 15-Mar-2014 Kenneth Graunke <kenneth@whitecape.org> glx/dri3: Implement LIBGL_SHOW_FPS=1 for DRI3/Present.

v2: Use the UST value provided in the PRESENT_COMPLETE_NOTIFY event
rather than gettimeofday(), which gives us the presentation time
instead of the time when SwapBuffers was called. Suggested by
Keith Packard. This relies on the fact that the X DRI3/Present
implementations use microseconds for UST.

v3: Properly ignore PresentCompleteKindMSCNotify; multiply in 64 bits
(caught by Keith Packard).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Keith Packard <keithp@keithp.com> [v3]
Reviewed-by: Marek Olšák <marek.olsak@amd.com> [v1]
/external/mesa3d/src/glx/dri3_priv.h
f7a355556ef5fe23056299a77414f9ad8b5e5a1d 02-Jul-2014 Keith Packard <keithp@keithp.com> glx/dri3: Use four buffers until X driver supports async flips

A driver which doesn't have async flip support will queue up flips without any
way to replace them afterwards. This means we've got a scanout buffer pinned
as soon as we schedule a flip and so we need another buffer to keep from
stalling.

When vblank_mode=0, if there are only three buffers we do:

current scanout buffer = 0 at MSC 0

Render frame 1 to buffer 1
PresentPixmap for buffer 1 at MSC 1

This is sitting down in the kernel waiting for vblank to
become the next scanout buffer

Render frame 2 to buffer 2
PresentPixmap for buffer 2 at MSC 1

This cannot be displayed at MSC 1 because the
kernel doesn't have any way to replace buffer 1 as the pending
scanout buffer. So, best case this will get displayed at MSC 2.

Now we block after this, waiting for one of the three buffers to become idle.
We can't use buffer 0 because it is the scanout buffer. We can't use buffer 1
because it's sitting in the kernel waiting to become the next scanout buffer
and we can't use buffer 2 because that's the most recent frame which will
become the next scanout buffer if the application doesn't manage to generate
another complete frame by MSC 2.

With four buffers, we get:

current scanout buffer = 0 at MSC 0

Render frame 1 to buffer 1
PresentPixmap for buffer 1 at MSC 1

This is sitting down in the kernel waiting for vblank to
become the next scanout buffer

Render frame 2 to buffer 2
PresentPixmap for buffer 2 at MSC 1

This cannot be displayed at MSC 1 because the
kernel doesn't have any way to replace buffer 1 as the pending
scanout buffer. So, best case this will get displayed at MSC
2. The X server will queue this swap until buffer 1 becomes
the scanout buffer.

Render frame 3 to buffer 3
PresentPixmap for buffer 3 at MSC 1

As soon as the X server sees this, it will replace the pending
buffer 2 swap with this swap and release buffer 2 back to the
application

Render frame 4 to buffer 2
PresentPixmap for buffer 2 at MSC 1

Now we're in a steady state, flipping between buffer 2 and 3
waiting for one of them to be queued to the kernel.

...

current scanout buffer = 1 at MSC 1

Now buffer 0 is free and (e.g.) buffer 2 is queued in
the kernel to be the scanout buffer at MSC 2

Render frames, flipping between buffer 0 and 3

When the system can replace a queued buffer, and we update Present to take
advantage of that, we can use three buffers and get:

current scanout buffer = 0 at MSC 0

Render frame 1 to buffer 1
PresentPixmap for buffer 1 at MSC 1

This is sitting waiting for vblank to become the next scanout
buffer

Render frame 2 to buffer 2
PresentPixmap for buffer 2 at MSC 1

Queue this for display at MSC 1
1. There are three possible results:

1) We're still before MSC 1. Buffer 1 is released,
buffer 2 is queued waiting for MSC 1.

2) We're now after MSC 1. Buffer 0 was released at MSC 1.
Buffer 1 is the current scanout buffer.

a) If the user asked for a tearing update, we swap
scanout from buffer 1 to buffer 2 and release buffer
1.

b) If the user asked for non-tearing update, we
queue buffer 2 for the MSC 2.

In all three cases, we have a buffer released (call it 'n'),
ready to receive the next frame.

Render frame 3 to buffer n
PresentPixmap for buffer n

If we're still before MSC 1, then we'll ask to present at MSC
1. Otherwise, we'll ask to present at MSC 2.

Present already does this if the driver offers async flips, however it does
this by waiting for the right vblank event and sending an async flip right at
that point.

I've hacked the intel driver to offer this, but I get tearing at the top of
the screen. I think this is because flips are always done from within the
ring, and so the latency between the vblank event and the async flip happening
can cause tearing at the top of the screen.

That's why I'm keying the need for the extra buffer on the lack of 2D
driver support for async flips.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
/external/mesa3d/src/glx/dri3_priv.h
3fe7daec14282dc8e2f5c8cc547927e305009677 17-Aug-2014 Jon TURNEY <jon.turney@dronecode.org.uk> glx: Fix build since 679c2ef "glx/drisw: add support for DRI2rendererQueryExtension", when only building drisw renderer

v2:
- Move dri*_query_renderer_* into their respective dri*_priv.h headers
- Drop then unnneeded include of dri2.h from dri2_query_renderer.c
- Rename dri2_query_renderer.c as dri_common_query_renderer.c, as it's contents
now are used for more than dri[23]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
/external/mesa3d/src/glx/dri3_priv.h
9320c8fea947fd0f6eb723c67f0bdb947e45c4c3 17-May-2014 Axel Davy <axel.davy@ens.fr> glx/dri3: add GPU offloading support.

The differences with DRI2 GPU offloading are:
a) There's no logic for GPU offloading needed in the Xserver

b) for DRI2, the card would render to a back buffer, and
the content would be copied to the front buffer (the same buffers
everytime). Here we can potentially use several back buffers and copy
to buffers with no tiling to share with X. We send them with the
Present extension.

That means than the DRI2 solution is forced to have tearings with GPU
offloading. In the ideal scenario, this DRI3 solution doesn't have this
problem.

However without dma-buf fences, a race can appear (if the card is slow
and the rendering hasn't finished before the server card reads the buffer),
and then old content is displayed. If a user hits this, he should probably
revert to the DRI2 solution (LIBGL_DRI3_DISABLE). Users with cards fast
enough seem to not hit this in practice (I have an Amd hd 7730m, and I
don't hit this, except if I force a low dpm mode)

c) for non-fullscreen apps, the DRI2 GPU offloading solution requires
compositing. This DRI3 solution doesn't have this requirement. Rendering
to a pixmap also works.

d) There is no need to have a DDX loaded for the secondary card.

V4: Fixes some piglit tests

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/glx/dri3_priv.h
625bdd64e5ea3327d4459b1ccccff8dab89129d0 20-Feb-2014 Ian Romanick <ian.d.romanick@intel.com> dri3: Enable GLX_MESA_query_renderer on DRI3 too

This should have happend around the time of commit 4680d23, but Keith's
DRI3 patches and my GLX_MESA_query_renderer patches crossed in the mail.

I don't have a working DRI3 setup, so I haven't been able to actually
verify this. I'm hoping that someone can piglit this for me on DRI3...
It's also unfortunate the DRI2 and DRI3 can't share more code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
/external/mesa3d/src/glx/dri3_priv.h
ecfe986120adb2c574cb03bea318eae96e564924 16-Mar-2014 Emil Velikov <emil.l.velikov@gmail.com> glx/dri3: rework __DRIextension handling

Use a const array with the extensions, rather than assigning each
one to a fixed size array at runtime.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glx/dri3_priv.h
a69fabc76cc5a8d744fb184bfc5a4096ee596c13 24-Feb-2014 Adel Gadllah <adel.gadllah@gmail.com> dri3: Add GLX_EXT_buffer_age support

v2: Indent according to Mesa style, reuse sbc instead of making a new
swap_count field, and actually get a usable back before returning the
age of the back (fixing updated piglit tests). Changes by anholt.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Robert Bragg <robert@sixbynine.org> (v1)
Reviewed-by: Adel Gadllah <adel.gadllah@gmail.com> (v2)
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glx/dri3_priv.h
3fbd1b0cb576b46ac8df2697cb388db78f48012d 27-Jan-2014 Keith Packard <keithp@keithp.com> dri3: Track current Present swap mode and adjust buffer counts

This automatically adjusts the number of buffers that we want based on
what swapping mode the X server is using and the current swap interval:

swap mode interval buffers
copy > 0 1
copy 0 2
flip > 0 2
flip 0 3

Note that flip with swap interval 0 is currently limited to twice the
underlying refresh rate because of how the kernel manages flipping. Moving
from 3 to 4 buffers would help, but that seems ridiculous.

v2: Just update num_back at the point that the values that change num_back
change. This means we'll have the updated value at the point that the
freeing of old going-to-be-unused backbuffers happens, which might not
have been the case before (change by anholt, acked by keithp).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glx/dri3_priv.h
71d614250ed1f83d8da3adb8e855ee00201c70da 26-Nov-2013 Keith Packard <keithp@keithp.com> dri3: Track full 64-bit SBC numbers, instead of just 32-bits

Tracking the full 64-bit SBC values makes it clearer how those values are
being used, and simplifies the wait_msc code. The only trick is in
re-constructing the full 64-bit value from Present's 32-bit serial number
that we use to pass the SBC value from request to event.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glx/dri3_priv.h
eac776cf779b705cbfb8d41812f1d171fb09c76f 11-Jan-2014 Emil Velikov <emil.l.velikov@gmail.com> glx: use the loader util lib

v2
* Set logger to ErrorMessageF. Spotted by Kristian

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glx/dri3_priv.h
6b5111398110f9ae374723ad6225ada1a0e60fd2 24-Nov-2013 Keith Packard <keithp@keithp.com> dri3: Rename DRI3_MAX_BACK to DRI3_NUM_BACK

It is the maximum number of back buffers, but the name is confusing and is
easily read as the maximum back buffer index. Chage to DRI3_NUM_BACK to make
the intended usage a bit clearer.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glx/dri3_priv.h
ca2012a912dcd3d671071ad7472c8a7c570745f2 26-Nov-2013 Keith Packard <keithp@keithp.com> dri3: Clean up struct dri3_drawable

Move the depth field up with width and height.

Remove unused previous_time and frames fields.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glx/dri3_priv.h
95b04850d0c578392288939723d8d56e4b600c93 22-Nov-2013 Keith Packard <keithp@keithp.com> dri3: Free resources when drawable is destroyed.

Always nice to clean up after ourselves.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glx/dri3_priv.h
568a27588d13146d0fd7cb4e775e1ac0187e5e29 22-Nov-2013 Keith Packard <keithp@keithp.com> dri3: Switch to libxshmfence version 1.1

libxshmfence v1.0 foolishly used 'int32_t *' for the fence type, which
works when the fence is a linux futex. However, version 1.1
changes the exported datatype to 'struct xshmfence *'

Require libxshmfence version 1.1 and switch the API around.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glx/dri3_priv.h
2d94601582e4f0fcaf8c02a15b23cba39dec7bb1 05-Nov-2013 Keith Packard <keithp@keithp.com> Add DRI3+Present loader

Uses the __DRIimage loader interfaces.

v2: Fix _XIOErrors when DRI3 isn't present (change by anholt). Apparently
XCB just terminates your connection if you don't check for extensions
before using them, instead of returning an error like you'd expect.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glx/dri3_priv.h