Commit Graph

2570 Commits

Author SHA1 Message Date
Brad Werth
8e3acc45f5 Bug 1764201 Part 3: Remove screen info stuff from gfxPlatform. r=jgilbert,geckoview-reviewers
The gfxPlatform::GetScreen* methods have always been redundant. Removing
them in favor of ScreenManager or nsDeviceContext methods will
discourage future code authors from adding more redundancy in
gfxPlatform.

Differential Revision: https://phabricator.services.mozilla.com/D203672
2024-03-22 00:55:48 +00:00
stransky
bb252b6267 Bug 1882779 [Linux] Always create offscreen rendering surface if we're missing native rendering window r=lsalzman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D204066
2024-03-21 15:14:17 +00:00
Sandor Molnar
9c939cb9a0 Backed out 7 changesets (bug 1882779) for causing perma mda failures @ test_getUserMedia_basicScreenshare.html
Backed out changeset c7d6f5ba608c (bug 1882779)
Backed out changeset d343fe633520 (bug 1882779)
Backed out changeset dcc81c544c72 (bug 1882779)
Backed out changeset f36a7bafc019 (bug 1882779)
Backed out changeset c621729acdc4 (bug 1882779)
Backed out changeset 5692d5a1b237 (bug 1882779)
Backed out changeset ae204d74a9f7 (bug 1882779)
2024-03-19 16:51:55 +02:00
stransky
3a3c585b8a Bug 1882779 [Linux] Always create offscreen rendering surface if we're missing native rendering window r=lsalzman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D204066
2024-03-19 12:15:46 +00:00
Mike Hommey
c70ca80cfd Bug 1884836 - Base graphics support for iOS. r=gfx-reviewers,bradwerth
Original work by Nika Layzell and Ted Mielczarek.

Of note:
- GLdouble and GLclampd are not defined in the iPhoneOS SDK opengl
  headers.
- GL_CONTEXT_PROVIDER_DEFAULT was defined too early for
  GLContextProviderEAGL to be used as intended.
- GLContextProviderEAGL::CreateForCompositorWidget was aligned with
  GLContextProviderCGL::CreateForCompositorWidget. There is a ton of
  overlap between both, but sharing more code was left out of scope.
- MacIOSurface::BindTexImage and
  SurfacePoolCA::LockedPool::GetFramebufferForSurface were left
  unimplemented.
- RootSnapshotter is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D204323
2024-03-15 01:28:27 +00:00
Stanca Serban
25baf2ac1a Backed out 2 changesets (bug 1884836) for causing mochitests failures in test_2_conformance__textures__misc__texture-corner-case-videos.html. CLOSED TREE
Backed out changeset 56bbc2a419e8 (bug 1884836)
Backed out changeset cc464f6e2cfb (bug 1884836)
2024-03-15 01:59:29 +02:00
Narcis Beleuzu
189b74c192 Bug 1884836 - Fix bustage on SharedSurfaceIO.cpp . r=glandium 2024-03-14 23:46:05 +02:00
Mike Hommey
a58d54f79b Bug 1884836 - Base graphics support for iOS. r=gfx-reviewers,bradwerth
Original work by Nika Layzell and Ted Mielczarek.

Of note:
- GLdouble and GLclampd are not defined in the iPhoneOS SDK opengl
  headers.
- GL_CONTEXT_PROVIDER_DEFAULT was defined too early for
  GLContextProviderEAGL to be used as intended.
- GLContextProviderEAGL::CreateForCompositorWidget was aligned with
  GLContextProviderCGL::CreateForCompositorWidget. There is a ton of
  overlap between both, but sharing more code was left out of scope.
- MacIOSurface::BindTexImage and
  SurfacePoolCA::LockedPool::GetFramebufferForSurface were left
  unimplemented.
- RootSnapshotter is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D204323
2024-03-14 20:56:50 +00:00
Mike Hommey
139ad31eee Bug 1884012 - Fall back to the warning-silencer case everywhere in SurfaceFactory::Create. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D203839
2024-03-07 00:53:05 +00:00
Mike Hommey
284211b72b Bug 1883508 - Fix build errors in GLContextProviderEAGL.mm. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D203524
2024-03-06 04:59:54 +00:00
Steve Fink
c19b37f030 Bug 1790873 - Send a full line at a time to printf_stderr in GLContext.cpp r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D166850
2024-02-28 18:15:03 +00:00
Cosmin Sabou
3077e1076d Backed out changeset 10faf99bbe8f (bug 1880016) as request by sotaro. 2024-02-13 18:13:04 +02:00
sotaro
2414d5152e Bug 1880016 - Make RenderDXGITextureHost::SyncObjectNeeded() return false when ID3D11Texture2D is created by compositor device r=gfx-reviewers,lsalzman
By default, hardware video decoder uses compositor device for D3D11Device. In this case, mSyncObject->Synchronize() in RenderCompositorANGLE::BeginFrame() is not necessary.

When ID3D11Texture2D is created by compositor device, the Synchronize() is not necessary.

Differential Revision: https://phabricator.services.mozilla.com/D201693
2024-02-13 15:12:28 +00:00
Jeff Muizelaar
239afc7998 Bug 1877726. Revert "Bug 1664063 - Ensure we consistently handle all errors from IDXGIKeyedMutex::AcquireSync.".
This reverts commit e25a5f344af32bdd689500bae7b4f24f205ba9f0.

We believe bug 1664063 was causing to hit some broken device reset
handling code.

Differential Revision: https://phabricator.services.mozilla.com/D201658
2024-02-13 04:25:35 +00:00
Jeff Muizelaar
ef806ed481 Bug 1879105. Generalize SamsungXclipse920 workaround to all Xclipse GPUs. r=gfx-reviewers,nical
We have reports of the same flickering that we were seeing on
Xclipse920 GPUs on Xclipse940. For now, let's just enable the workaround
on all Xclipse GPUs.

Differential Revision: https://phabricator.services.mozilla.com/D200944
2024-02-07 15:59:04 +00:00
Kelsey Gilbert
fc79a725c9 Bug 1877341 - Reset GLContext TLS current-context caching when calling library MakeCurrent symbols. r=gfx-reviewers,ahale
Differential Revision: https://phabricator.services.mozilla.com/D199947
2024-02-01 18:44:20 +00:00
sotaro
5eabf27101 Bug 1817617 - Wait ID3D11Query of D3D11Texture2D copy complete just before blitting for video overlay with non Intel GPUs r=media-playback-reviewers,padenot
Normally when D3D11Texture2D is copied by ID3D11DeviceContext::CopySubresourceRegion() with compositor device, WebRender does not need to wait copy complete, since WebRender also uses compositor device.

But with Non-intel GPUs(like NDIVIA), there is a case that the copy complete need to be wait explicitly even with compositor device

mSyncObject->Synchronize() could not be used with compositor device.

Wait of the query is not called in D3D11DXVA2Manager::CopyToImage(), since the wait could take long time. Then the Wait of the query is deferred to just before blitting for video overlay.

Differential Revision: https://phabricator.services.mozilla.com/D200041
2024-02-01 10:28:32 +00:00
Sandor Molnar
26c16e2b65 Backed out changeset 30f4e9c2f11e (bug 1877341) for causing build bustages at gfx/gl/GLLibraryEGL.h CLOSED TREE 2024-01-31 21:29:48 +02:00
Kelsey Gilbert
12fa277cdd Bug 1877341 - Reset GLContext TLS current-context caching when calling library MakeCurrent symbols. r=gfx-reviewers,ahale
Differential Revision: https://phabricator.services.mozilla.com/D199947
2024-01-31 19:00:53 +00:00
Kelsey Gilbert
8a90064236 Bug 1873507 - Replace ScopedXFree<GLXFBConfig> with MakeScopeExit. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D198089
2024-01-25 23:10:26 +00:00
Lee Salzman
80306e69c7 Bug 1875193 - Don't recycle SharedSurfaces from different SurfaceFactory. r=sotaro
It looks like we're accidentally putting SharedSurfaces that came from a different
SurfaceFactory back into a different one recycling. This happens because on context
loss in CanvasTranslator, the old GL context may go away, though the RemoteTextureOwnerClient
has a shared recycling bin that might accidentally keep the old surfaces.

This also tries to clear the old recycled surfaces as soon as possible on a context
loss now.

Differential Revision: https://phabricator.services.mozilla.com/D198918
2024-01-18 06:46:51 +00:00
Kelsey Gilbert
ef87b37f72 Bug 1655101 - Allow webgl.texImage gpu-blit for RGB8 if supported. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D194943
2024-01-04 18:38:52 +00:00
sotaro
7d06300567 Bug 1861605 - Use IDXGIResource1::CreateSharedHandle() instead of IDXGIResource::GetSharedHandle() r=gfx-reviewers,lsalzman
gecko uses IDXGIResource::GetSharedHandle(). But it is recommend not to use anymore to retrieve the handle to a shared resource.
IDXGIResource1::CreateSharedHandle() with D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag should be used instead of the GetSharedHandle().

The CreateSharedHandle() could be called only once for a shared resource. Later calls fail.

HANDLEs of ID3D11Texture2D are replaced by gfx::FileHandleWrappers.

Differential Revision: https://phabricator.services.mozilla.com/D192173
2023-12-19 09:23:21 +00:00
Lee Salzman
772134201a Bug 1829026 - Allow invalidating the current TLS context on establishing TLS scope. r=aosmond
On a given thread, if there are outside users of OpenGL (such as WebRender) that don't go
through the GLContext interface to set the current context, the TLS current context value
may be incorrect. To solve this, we need to assume that on establishing some TLS scopes,
that the current context value is unreliable and invalidate it so that it gets properly
reset.

Differential Revision: https://phabricator.services.mozilla.com/D194350
2023-12-18 18:10:46 +00:00
Andrew Osmond
9850d508cd Bug 1664063 - Ensure we consistently handle all errors from IDXGIKeyedMutex::AcquireSync. r=gfx-reviewers,lsalzman
When we call IDXGIKeyedMutex::AcquireSync, we need to check for a
general failure, WAIT_ABANDONED and WAIT_TIMEOUT. The last two are
special because Microsoft's SUCCEEDED and FAILED macros consider them
successful.

Differential Revision: https://phabricator.services.mozilla.com/D196668
2023-12-18 16:41:54 +00:00
Jamie Nicol
e757333eb9 Bug 1869569 - Avoid CompositorOGL::BeginFrame's glInvalidateFramebuffer optimization on Xclipse 920 GPU. r=gfx-reviewers,nical
In CompositorOGL (used by software webrender on Android) as an
optimization we use glInvalidateFramebuffer rather than glClear for
the color attachment if there is no non-opaque invalid region. This
causes rendering glitches on the Samsung Xclipse 920 GPU. This patch
marks GLfeature::invalidate_framebuffer as unsupported on this GPU,
causing us to fall back to the glClear pach which avoids the glitches.

Differential Revision: https://phabricator.services.mozilla.com/D196416
2023-12-14 14:07:20 +00:00
Jamie Nicol
d20809a078 Bug 1866020 - Override buggy colorspace conversion on Pixel devices. r=gw,padenot,geckoview-reviewers,owlish
Pixel 6, 7, and 8 devices running Android 14 are affected by a bug
where video frames with SMPTE 432 color primaries are rendered
incorrectly when sampled from an external texture in GLES. To work
around this, we force these frames to be converted to RGB using BT709
colorspace instead. While this won't look exactly right, it is much
better than the current situation.

When we detect that a frame is decoded with that color space on an
affected device, we set a "ForceBT709" flag which gets passed through
to webrender as a new ImageBufferKind. Rendering this ImageBufferKind
is handled via a new shader feature TEXTURE_EXTERNAL_BT709, which
works much like the existing TEXTURE_EXTERNAL feature, but
additionally uses the EXT_YUV_TARGET extension to override the
colorspace transformation.

This approach could be extended in the future to handle additional
colorspace transformations, but for now only handles the one required
to workaround this particular driver bug.

Differential Revision: https://phabricator.services.mozilla.com/D195800
2023-12-14 10:45:08 +00:00
Butkovits Atila
fcac574890 Merge autoland to mozilla-central. a=merge 2023-12-13 23:40:45 +02:00
Sebastian Hengst
4d6a5b9742 Backed out 10 changesets (bug 1829026) for causing bug 1869760 and bug 1869738. a=backout
Backed out changeset 4c619422efe5 (bug 1829026)
Backed out changeset 77da89c7dab7 (bug 1829026)
Backed out changeset 19d28d8f75a4 (bug 1829026)
Backed out changeset 674b60ba54b1 (bug 1829026)
Backed out changeset 31935f164ef0 (bug 1829026)
Backed out changeset 13c9bf69085f (bug 1829026)
Backed out changeset 330a6732fc0b (bug 1829026)
Backed out changeset 974c08a3791b (bug 1829026)
Backed out changeset 3ba040642ddc (bug 1829026)
Backed out changeset 9d9b3a68858c (bug 1829026)
2023-12-13 19:20:00 +01:00
Jamie Nicol
3104637fd7 Bug 1868825 - Leak EGLDisplays on Samsung S22 devices. r=gfx-reviewers,nical,ahale
We are seeing crashes on the european Samsung S22 family of devices in
eglTerminate after updating to Android 14. To work around this we
deliberately leak the EGLDisplay on affected devices. In practice we
only ever use the default EGLDisplay on Android, and calling
eglInitialize multiple times is allowed, so this is fine.

Note this only occurs when running webgl in the content process, which
will occur naturally following enough GPU process crashes that we
disable the GPU process. When webgl is running in the GPU process
webrender keeps the EGLDisplay alive, meaning we never terminate it.

Differential Revision: https://phabricator.services.mozilla.com/D196146
2023-12-13 11:29:18 +00:00
Stanca Serban
7639e8a620 Backed out changeset 5105ca2d1171 (bug 1868825) for causing bp-nu bustages in GLLibraryEGL.h. CLOSED TREE 2023-12-13 12:29:58 +02:00
Narcis Beleuzu
4211076193 Backed out changeset 290917deea87 (bug 1866020) for wrench bustages. CLOSED TREE 2023-12-13 11:49:40 +02:00
Jamie Nicol
4bc580f7c5 Bug 1868825 - Leak EGLDisplays on Samsung S22 devices. r=gfx-reviewers,nical,ahale
We are seeing crashes on the european Samsung S22 family of devices in
eglTerminate after updating to Android 14. To work around this we
deliberately leak the EGLDisplay on affected devices. In practice we
only ever use the default EGLDisplay on Android, and calling
eglInitialize multiple times is allowed, so this is fine.

Note this only occurs when running webgl in the content process, which
will occur naturally following enough GPU process crashes that we
disable the GPU process. When webgl is running in the GPU process
webrender keeps the EGLDisplay alive, meaning we never terminate it.

Differential Revision: https://phabricator.services.mozilla.com/D196146
2023-12-13 09:39:59 +00:00
Jamie Nicol
96a8082a23 Bug 1866020 - Override buggy colorspace conversion on Pixel devices. r=gw,padenot,geckoview-reviewers,owlish
Pixel 6, 7, and 8 devices running Android 14 are affected by a bug
where video frames with SMPTE 432 color primaries are rendered
incorrectly when sampled from an external texture in GLES. To work
around this, we force these frames to be converted to RGB using BT709
colorspace instead. While this won't look exactly right, it is much
better than the current situation.

When we detect that a frame is decoded with that color space on an
affected device, we set a "ForceBT709" flag which gets passed through
to webrender as a new ImageBufferKind. Rendering this ImageBufferKind
is handled via a new shader feature TEXTURE_EXTERNAL_BT709, which
works much like the existing TEXTURE_EXTERNAL feature, but
additionally uses the EXT_YUV_TARGET extension to override the
colorspace transformation.

This approach could be extended in the future to handle additional
colorspace transformations, but for now only handles the one required
to workaround this particular driver bug.

Differential Revision: https://phabricator.services.mozilla.com/D195800
2023-12-13 09:06:29 +00:00
Lee Salzman
07a5849be8 Bug 1829026 - Allow invalidating the current TLS context on establishing TLS scope. r=aosmond
On a given thread, if there are outside users of OpenGL (such as WebRender) that don't go
through the GLContext interface to set the current context, the TLS current context value
may be incorrect. To solve this, we need to assume that on establishing some TLS scopes,
that the current context value is unreliable and invalidate it so that it gets properly
reset.

Differential Revision: https://phabricator.services.mozilla.com/D194350
2023-12-12 07:35:02 +00:00
sotaro
86d050de4e Bug 1866412 - Add FenceD3D11 for wrapping ID3D11Fence r=gfx-reviewers,jrmuizel
The change is a preparation for Bug 1865984, Bug 1863474 and Bug 1861605.

FenceD3D11 is going to be used by Bug 1865984 and Bug 1863474. And FileHandleWrapper is going to be added for wrapping shared handle of ID3D11Fence and ID3D11Texture2D(Bug 1861605).

For now, FenceInfo is expected to be delivered just during creating TextureHost. It works for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D194612
2023-12-09 11:55:15 +00:00
Stanca Serban
b57f879b5e Backed out changeset 54e35266f616 (bug 1866412) for causing bp-nu bustages in RenderD3D11TextureHost.cpp. CLOSED TREE 2023-12-08 11:00:31 +02:00
sotaro
3e3409b160 Bug 1866412 - Add FenceD3D11 for wrapping ID3D11Fence r=gfx-reviewers,jrmuizel
The change is a preparation for Bug 1865984, Bug 1863474 and Bug 1861605.

FenceD3D11 is going to be used by Bug 1865984 and Bug 1863474. And FileHandleWrapper is going to be added for wrapping shared handle of ID3D11Fence and ID3D11Texture2D(Bug 1861605).

For now, FenceInfo is expected to be delivered just during creating TextureHost. It works for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D194612
2023-12-08 05:13:57 +00:00
Cosmin Sabou
6f5d4853e5 Backed out 8 changesets (bug 1829026) for causing several mochitest failures. CLOSED TREE
Backed out changeset 790ba6aa65e4 (bug 1829026)
Backed out changeset 2ff1f5f41380 (bug 1829026)
Backed out changeset de6ddf5eb2a7 (bug 1829026)
Backed out changeset 773e7b31ac6e (bug 1829026)
Backed out changeset e09602ab096d (bug 1829026)
Backed out changeset fe16d4ac1049 (bug 1829026)
Backed out changeset c0fe0aea86c2 (bug 1829026)
Backed out changeset 53d6f69055f1 (bug 1829026)
2023-12-05 16:08:36 +02:00
Lee Salzman
4cf322976a Bug 1829026 - Allow invalidating the current TLS context on establishing TLS scope. r=aosmond
On a given thread, if there are outside users of OpenGL (such as WebRender) that don't go
through the GLContext interface to set the current context, the TLS current context value
may be incorrect. To solve this, we need to assume that on establishing some TLS scopes,
that the current context value is unreliable and invalidate it so that it gets properly
reset.

Differential Revision: https://phabricator.services.mozilla.com/D194350
2023-12-05 09:37:02 +00:00
Sylvestre Ledru
ef35fa7374 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot
clang-format version 17.0.6 (taskcluster-QueHFUviQeyM8Y7r_d7MQQ)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D195397
2023-12-04 10:09:36 +00:00
Cosmin Sabou
36061c2d62 Backed out changeset 7aa58b8ef68a (bug 1655101) for causing bustages on dom/WebGLIpdl.h. CLOSED TREE 2023-11-30 21:06:53 +02:00
Kelsey Gilbert
f69f941a95 Bug 1655101 - Allow webgl.texImage gpu-blit for RGB8 if supported. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D194943
2023-11-30 17:40:42 +00:00
Ashley Hale
8c0266380b Bug 1843782 - WebGL software rendering when mesa/vmwgfx driver detected r=gfx-reviewers,bradwerth,jrmuizel,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D192039
2023-11-29 21:45:27 +00:00
Butkovits Atila
fe1644b3dc Backed out changeset 8d11a3a0d707 (bug 1843782) for causing failures complaining about RemoteProcessMonitor . CLOSED TREE 2023-11-29 05:51:34 +02:00
Ashley Hale
5fed10025e Bug 1843782 - WebGL software rendering when mesa/vmwgfx driver detected r=gfx-reviewers,bradwerth,jrmuizel,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D192039
2023-11-29 02:15:17 +00:00
Sandor Molnar
3b95748905 Backed out changeset c1e95a42b8d7 (bug 1843782) for causing gv-junit-fis failures. CLOSED TREE 2023-11-28 02:31:02 +02:00
Ashley Hale
5150f6a2bf Bug 1843782 - WebGL software rendering when mesa/vmwgfx driver detected r=gfx-reviewers,bradwerth,jrmuizel,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D192039
2023-11-27 23:25:14 +00:00
sotaro
916658f69e Bug 1865991 - Allocate ID3D11Texture2D in SharedSurface_ANGLEShareHandle::Create() r=gfx-reviewers,lsalzman
In current gecko, SharedSurface_ANGLEShareHandle requests ANGLE to allocate ID3D11Texture2D. But Bug 1865984 and Bug 1861605 requests to change D3D11_TEXTURE2D_DESC::MiscFlags. To do it, the ID3D11Texture2D needs to be allocated by SharedSurface_ANGLEShareHandle.

Differential Revision: https://phabricator.services.mozilla.com/D194332
2023-11-23 00:28:09 +00:00
sotaro
b0e7e3f3ea Bug 1865986 - Remove ScopedLockTexture r=gfx-reviewers,lsalzman
ScopedLockTexture is not used.

Differential Revision: https://phabricator.services.mozilla.com/D194330
2023-11-22 08:04:52 +00:00