Commit Graph

2401 Commits

Author SHA1 Message Date
Jamie Nicol
0cffcc7253 Bug 1777952 - Namespace SurfaceTexture handles by the process they were allocated in. r=gfx-reviewers,geckoview-reviewers,aosmond,calu
When Surfaces/SurfaceTextures are allocated they are given a handle,
which is a monotonically increasing 32-bit integer. To render
Surfaces, we typically pass the Surface handle to the compositor,
which then looks it up in a map to find the corresponding
SurfaceTexture.

Following a GPU process restart, content may be left with stale
handles referencing SurfaceTextures which no longer exist. Once new
SurfaceTextures are allocated, these stale handles may reference new
SurfaceTextures with no relation to the old handle. This can lead to
rendering the wrong texture. Additionally, we may crash when
allocating "sync" SurfaceTextures, as the previous sync texture for a
certain handle may not have been released yet.

To fix this, this patch combines the existing handle with a new ID
uniquely identifying the process in which the SurfaceTexture was
allocated (or 0 for the parent process). We use a monotonically
increasing value rather than the pid to guard against the new GPU
process possibly having the same pid as the previous instance. We
combine these two 32-bit integers and use the resulting 64-bit integer
as the Surface handle.

Differential Revision: https://phabricator.services.mozilla.com/D150963
2022-07-07 08:12:55 +00:00
Kelsey Gilbert
4f87812c0f Bug 1778232 - ImageFormat::s/CAIRO_SURFACE/MOZ2D_SURFACE/. r=jrmuizel
Also remove comment that says it can't be off-main-thread.

Differential Revision: https://phabricator.services.mozilla.com/D151087
2022-07-06 07:46:17 +00:00
Kelsey Gilbert
98e17790db Bug 1776470 - Explicitly ask for ANGLE debug layer iff d3d11 debug layer pref enabled. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D150274
2022-07-06 07:45:29 +00:00
smolnar
3fa084ce2f Backed out 3 changesets (bug 1771374) for causing build bustage in gfx/gl/gtest/TestColorspaces.cpp CLOSED TREE
Backed out changeset 4d01f260c43a (bug 1771374)
Backed out changeset fc62679f0a6c (bug 1771374)
Backed out changeset f4f12470f8b7 (bug 1771374)
2022-06-30 21:19:17 +03:00
Kelsey Gilbert
ec0b1e1d29 Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-30 17:56:27 +00:00
Kelsey Gilbert
bb48a57a8a Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-30 17:56:26 +00:00
criss
d5ece910a9 Backed out 3 changesets (bug 1771374) for causing bustages on Colorspaces.h. CLOSED TREE
Backed out changeset 498c27656dc3 (bug 1771374)
Backed out changeset 6f97bc39643f (bug 1771374)
Backed out changeset b4fdb70808b6 (bug 1771374)
2022-06-30 05:28:11 +03:00
Kelsey Gilbert
8fdac7788a Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-29 23:38:23 +00:00
Kelsey Gilbert
c4f86e2e33 Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 23:38:22 +00:00
criss
efb5f18b59 Backed out 3 changesets (bug 1771374) for causing build bustages on GLBlitHelper.cpp. CLOSED TREE
Backed out changeset 71d40a0a3c9c (bug 1771374)
Backed out changeset 6a42df6834fe (bug 1771374)
Backed out changeset be888d0fd0bf (bug 1771374)
2022-06-30 01:12:46 +03:00
Kelsey Gilbert
7cf061700c Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-29 21:48:53 +00:00
Kelsey Gilbert
bad5d9146c Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 21:48:52 +00:00
sotaro
a807c798e9 Bug 1712486 - Add async front buffer posting for out-of-process WebGL r=jgilbert,lsalzman,gfx-reviewers
The async front buffer posting is going to be enabled by another bug.

Async IPC was added for async front buffer posting for out-of-process WebGL.
Client does not use TextureClient for storing SurfaceDescriptor.
It works basically same way as to in-process WebGL around nsDisplayCanvas, WebRenderCanvasData, WebRenderCommandBuilder and WebRenderBridgeParent.
SharedSurfaces of SurfaceDescriptorD3D10 are kept alive during their usage. It is for keeping a shread handle valid.
Copied data buffers of SharedShurface_Basics are kept alive during their usage. It is for keeping RenderBufferTextureHost valid.

Differential Revision: https://phabricator.services.mozilla.com/D150197
2022-06-29 09:32:29 +00:00
Norisz Fay
f70f5a4b0f Backed out changeset af98fb4ff148 (bug 1712486) for causing build bustages on LayersSurfaces CLOSED TREE 2022-06-29 09:06:45 +03:00
sotaro
8a8d04cce2 Bug 1712486 - Add async front buffer posting for out-of-process WebGL r=jgilbert,lsalzman,gfx-reviewers
The async front buffer posting is going to be enabled by another bug.

Async IPC was added for async front buffer posting for out-of-process WebGL.
Client does not use TextureClient for storing SurfaceDescriptor.
It works basically same way as to in-process WebGL around nsDisplayCanvas, WebRenderCanvasData, WebRenderCommandBuilder and WebRenderBridgeParent.
SharedSurfaces of SurfaceDescriptorD3D10 are kept alive during their usage. It is for keeping a shread handle valid.
Copied data buffers of SharedShurface_Basics are kept alive during their usage. It is for keeping RenderBufferTextureHost valid.

Differential Revision: https://phabricator.services.mozilla.com/D150197
2022-06-29 05:05:47 +00:00
Kelsey Gilbert
c6b76d3b9a Bug 1776465 - GLBlitHelper link failure should go down link failure branch. r=gfx-reviewers,lsalzman
Also, no reason not to complete iteration across uTex[012], as opposed
to breaking early once we hit the first one that isn't present.
A shader with e.g. uTex1 but not uTex0 is weird, but there's no reason
for it not to work.

Differential Revision: https://phabricator.services.mozilla.com/D150270
2022-06-24 18:29:58 +00:00
stransky
1cdfeeec54 Bug 1774075 [Linux] Don't use EGL_MESA_image_dma_buf_export on mesa/radeonsi driver r=jgilbert
Don't use EGL_MESA_image_dma_buf_export on Mesa/radeonsi driver due to multi-thread crash there (https://gitlab.freedesktop.org/mesa/mesa/-/issues/6666)

Differential Revision: https://phabricator.services.mozilla.com/D149238
2022-06-20 10:14:41 +00:00
Robert Mader
d8d4d7a87a Bug 1773377 - Try EGL device platform for headless contexts, r=stransky,jgilbert
On multi-GPU setups, EGLs "surfaceless" platform may pick the wrong device.
There is a very recent extension which solves this issue,
`EGL_EXT_explicit_device`, however it states:
> Using EGL_EXT_explicit_device with EGL_MESA_platform_surfaceless is
> functionally identical to EGL_EXT_platform_device.

Thus, if we previously detected a render node device, use
`EGL_EXT_platform_device` to create the display in headless scenarios.

For all other cases, notably ARM SOCs where
`EGL_DRM_RENDER_NODE_FILE_EXT` is not yet availble, continue to
fall back to the surfaceless platform.

Note: this patch also does some cleanups. Most importantly,
`EGL_MESA_platform_surfaceless` is a client extension, not a
display extension. The check for it must thus always have failed.
Instead, check for it before trying to use it when creating the
display.
Also remove the rendundant redifinition in `GLDefs.h` - it's
already included in the upstream EGL headers.

Differential Revision: https://phabricator.services.mozilla.com/D148946
2022-06-13 23:15:37 +00:00
stransky
b887666c92 Bug 1735929 [Linux] Use EGL_MESA_image_dma_buf_export in SharedSurfaceDMABUF r=jgilbert,aosmond
- Update SharedSurfaceDMABUF for EGL_MESA_image_dma_buf_export DMABufSurface interface.
- Test surface export and import in SurfaceFactory_DMABUF::CanCreateSurface() to make sure it really works.

Depends on D147636

Differential Revision: https://phabricator.services.mozilla.com/D147637
2022-06-09 08:37:20 +00:00
stransky
08d59365a9 Bug 1735929 [Linux] Add support of EGL_MESA_image_dma_buf_export to GLLibraryEGL r=jgilbert,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D147635
2022-06-09 08:37:19 +00:00
Sylvestre Ledru
42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Ashley Hale
2879b04886 Bug 1772947 - Remove dead code DecomposeIntoNoRepeatTriangles. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D148455
2022-06-07 00:07:28 +00:00
Jamie Nicol
68af928298 Bug 1772849 - Annotate crash reports with eglCreateWindowSurface error code on Android. r=gfx-reviewers,jgilbert,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D148410
2022-06-06 18:12:39 +00:00
stransky
b292c031de Bug 1770560 [Linux] Implement GLBlitHelper::Blit(DMABufSurface* surface,...) to blit DMABufSurface directly r=sotaro,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146989
2022-06-06 13:31:03 +00:00
stransky
a3d16af2f2 Bug 1770407 [Linux] Remove GBM GL backend r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D147421
2022-05-28 20:13:42 +00:00
stransky
c85f81924d Bug 1770407 [Linux] Use MESA_platform_surfaceless GL backed on Linux instead of GBM one r=jgilbert
MESA_platform_surfaceless provides better alternative to GBM GL backend so let's use that instead of GBM.

Differential Revision: https://phabricator.services.mozilla.com/D147420
2022-05-28 20:13:42 +00:00
Emilio Cobos Álvarez
ddb8e6f491 Bug 1771146 - Check for gbm availability correctly before trying to create a surface. r=stransky,jgilbert
(And try to make it cheaper).

Differential Revision: https://phabricator.services.mozilla.com/D147312
2022-05-27 07:35:44 +00:00
Lee Salzman
8aba061809 Bug 1685375 - Remove ScopedXErrorHandler. r=jgilbert
Avoid relying on X11 errors to detect failures where alternative means would
suffice (i.e. checking results for failure or MakeCurrent failures). All other
users of ScopedXErrorHandler outside of GLContextProviderGLX use it only to
ignore errors rather than actually check the error result. Given those concerns,
we also change the default X11 error handler to merely ignore errors rather than
abort, such that X11 calls in Gecko no longer require an error trap by default.
This also avoids contention with other libraries that may temporarily override
the error handler such as GDK or Cairo since Gecko will never touch the handler
after startup.

Differential Revision: https://phabricator.services.mozilla.com/D147247
2022-05-26 16:13:27 +00:00
Cristian Tuns
21e50ef423 Backed out changeset b1345ce6dcd3 (bug 1685375) for causing xpcshell failures on test_crash_backgroundtask_moz_crash.js,nsX11ErrorHandler.cpp CLOSED TREE 2022-05-26 00:25:00 -04:00
Lee Salzman
2d5de179cb Bug 1685375 - Remove ScopedXErrorHandler. r=jgilbert
Avoid relying on X11 errors to detect failures where alternative means would
suffice (i.e. checking results for failure or MakeCurrent failures). All other
users of ScopedXErrorHandler outside of GLContextProviderGLX use it only to
ignore errors rather than actually check the error result. Given those concerns,
we also change the default X11 error handler to merely ignore errors rather than
abort, such that X11 calls in Gecko no longer require an error trap by default.
This also avoids contention with other libraries that may temporarily override
the error handler such as GDK or Cairo since Gecko will never touch the handler
after startup.

Differential Revision: https://phabricator.services.mozilla.com/D147247
2022-05-26 01:58:49 +00:00
stransky
a903faa3e1 Bug 1770111 [Linux] Build GLContextProviderLinux on other unix systems r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146816
2022-05-20 12:37:08 +00:00
Norisz Fay
840028742a Backed out changeset cde097a49a39 (bug 1770111) for causing build bustages on GLContextProvider.h CLOSED TREE 2022-05-20 10:25:35 +03:00
stransky
3da535a403 Bug 1770111 [Linux] Build GLContextProviderLinux on other unix systems r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146816
2022-05-20 07:12:22 +00:00
sotaro
4f8549101c Bug 1766282 - Do not use SharedHandle of ID3D11Texture2D of hardware decoded video during no video copy r=jgilbert,jrmuizel,gfx-reviewers
With CI's NVIDIA GPU, SharedHandle of ID3D11Texture2D of hardware decoded video during no video copy caused rendering problem. When SharedHandle is not used, the rendering problem did not happen. But when video is rendered to WebGL texture, SharedHandle need to be used.
In this case, D3D11TextureIMFSampleImage copies original ID3D11Texture2D to a new ID3D11Texture2D and use a shared handled of the copied texture. And no video copy of future video frames are disabled.

NoCopyNV12Texture is renamed to ZeroCopyNV12Texture to clarify its meaning.

Differential Revision: https://phabricator.services.mozilla.com/D144598
2022-05-20 04:37:53 +00:00
Kelsey Gilbert
2bd9efd83a Bug 1770235 - DrawBlitProg::Draw non-vao path must restore vaa0's buffer. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D146844
2022-05-19 23:00:33 +00:00
stransky
9f95c41a96 Bug 1769499 [Linux/EGL] Create GBM based surface for headless GL context r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146555
2022-05-19 15:18:22 +00:00
criss
dd9c3d30c8 Backed out changeset d13c0a1c7a19 (bug 1769499) for causing bustages on GLContextProviderEGL.cpp. CLOSED TREE 2022-05-19 10:27:48 +03:00
stransky
8979f28b18 Bug 1769499 [Linux/EGL] Create GBM based surface for headless GL context r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146555
2022-05-19 06:34:20 +00:00
stransky
9f92539de5 Bug 1769710 [Linux] Use GLContextProviderLinux on Linux r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146549
2022-05-18 12:01:50 +00:00
stransky
a734b8d21d Bug 1769710 [Linux] Remove GLContextProviderX11 r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146548
2022-05-18 12:01:50 +00:00
stransky
7ee135958e Bug 1769710 [Linux] Remove GLContextProviderWayland r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146547
2022-05-18 12:01:49 +00:00
stransky
126f981f9a Bug 1769710 [Linux] Add GLContextProviderLinux for GLX/EGL r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146546
2022-05-18 12:01:49 +00:00
Cristian Tuns
e7e8403c3b Backed out 4 changesets (bug 1769710) for causing build bustages on Android CLOSED TREE
Backed out changeset 05fe9638ac05 (bug 1769710)
Backed out changeset 7ddd8fdfe957 (bug 1769710)
Backed out changeset b8191e074d6d (bug 1769710)
Backed out changeset 202d09293cf2 (bug 1769710)
2022-05-18 03:09:03 -04:00
stransky
8555fad567 Bug 1769710 [Linux] Use GLContextProviderLinux on Linux r=jgilbert
Depends on D146548

Differential Revision: https://phabricator.services.mozilla.com/D146549
2022-05-18 06:43:48 +00:00
stransky
d1b8efc7b4 Bug 1769710 [Linux] Remove GLContextProviderX11 r=jgilbert
Depends on D146547

Differential Revision: https://phabricator.services.mozilla.com/D146548
2022-05-18 06:43:48 +00:00
stransky
d880bc82cf Bug 1769710 [Linux] Remove GLContextProviderWayland r=jgilbert
Depends on D146546

Differential Revision: https://phabricator.services.mozilla.com/D146547
2022-05-18 06:43:47 +00:00
stransky
6891e2856b Bug 1769710 [Linux] Add GLContextProviderLinux for GLX/EGL r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146546
2022-05-18 06:43:47 +00:00
Kelsey Gilbert
e722cdd3ed Bug 1703654 - Prototype display-p3 for WebGL canvas. r=lsalzman,emilio,webidl,smaug
Enable (direct) external surface compositing for MacIOSurfaces.
Works on Mac.

Differential Revision: https://phabricator.services.mozilla.com/D144073
2022-05-02 23:54:09 +00:00
Csoregi Natalia
9a8af5a95a Backed out changeset 718ead395698 (bug 1703654) for causing bustage on IPCMessageUtils.h. CLOSED TREE 2022-04-29 00:38:28 +03:00
Kelsey Gilbert
c3a7e39783 Bug 1703654 - Prototype display-p3 for WebGL canvas. r=lsalzman,emilio
Enable (direct) external surface compositing for MacIOSurfaces.
Works on Mac.

Differential Revision: https://phabricator.services.mozilla.com/D144073
2022-04-28 19:12:08 +00:00