Commit Graph

3168 Commits

Author SHA1 Message Date
Cameron Gutman
b8e9262b1b Replace deprecated DXVA2 initialization with standard hwaccel init
- Avoids requiring a hardcoded number of frames (and creating surfaces ourselves)
- Removes a ton of unnecessary code that's duplicated in FFmpeg
- Supports dynamic frame sizes, formats, and color conversion
- Supports frame cropping in FFmpeg
2026-01-11 17:46:13 -06:00
Cameron Gutman
c14ebb1ad7 Adjust buffer count for hwaccel and v4l2m2m decoders
- For hwaccel decoders, don't depend on FFmpeg's 4 working surfaces.
  The decoders might need one or more of them internally.

- For V4L2M2M decoders, adjust the buffer counts to match our needs
  and requirements regarding Pacer-held frames.
2026-01-11 14:18:22 -06:00
Cameron Gutman
d3957b3cbb Fix race condition where a separate test decoder could ingest a real frame 2026-01-11 13:41:12 -06:00
Cameron Gutman
a8e8efb17b Don't blend the source surface when blitting 2026-01-11 12:35:55 -06:00
Cameron Gutman
75adc22d05 Blit the new overlay in one shot if it entirely covers the old one 2026-01-11 12:28:22 -06:00
Cameron Gutman
2549efc8b3 Fix pthread_attr leak 2026-01-11 01:47:11 -06:00
Cameron Gutman
6f8e517ce1 Remove unused field 2026-01-11 01:46:17 -06:00
Cameron Gutman
09f8e7117b Fix incorrect src pixel offset in overlay composition
Currently harmless because no overlay has a non-zero X coordinate.
2026-01-11 01:40:32 -06:00
Cameron Gutman
88719cc8bf Use FB_DAMAGE_CLIPS instead of drmModeDirtyFB() 2026-01-11 01:15:28 -06:00
Cameron Gutman
3ea62c0800 Call drmModeDirtyFB() for the modified composition regions 2026-01-10 23:53:07 -06:00
Cameron Gutman
7643cc929e Implement DRM overlay composition
This allows overlays to work on drivers that only have one usable
overlay plane and when we are using the primary plane (which often
must be exactly CRTC-sized) to overlay on top of a video underlay.
2026-01-10 23:40:12 -06:00
Cameron Gutman
a58d3cfe39 Fix D3D11 copy path 2026-01-10 19:11:25 -06:00
Cameron Gutman
b41c4022ea Ensure there are enough hwframes for Pacer 2026-01-10 18:13:49 -06:00
Cameron Gutman
788675ad59 Handle window size and display changes in D3D11Renderer 2026-01-10 17:48:28 -06:00
Cameron Gutman
be9f465008 Remove manual hwframes creation in D3D11VARenderer
This way we aren't always allocating the worst-case possible number of frames
2026-01-10 16:36:35 -06:00
Cameron Gutman
8b6ad55c9b Enable DXGI_CREATE_FACTORY_DEBUG for debug builds 2026-01-10 16:01:03 -06:00
Cameron Gutman
92b68a40d1 Use a D3D11Fence to force sync between video and 3D engines when binding output textures 2026-01-10 14:52:27 -06:00
Cameron Gutman
a931161923 Reset client caps before rendering in case SDL changed them 2026-01-08 22:03:44 -06:00
Cameron Gutman
37b9b6ed9e Don't run configuration checks for CLI launches 2026-01-08 19:10:50 -06:00
Cameron Gutman
fad197fdce Move heavy SystemProperties initialization operations off the main thread
This dramatically improves startup performance on slow devices.
2026-01-08 19:09:54 -06:00
Cameron Gutman
cda65ab58d Use a D3D11Fence to wait to start the next frame until the previous frame is finished 2026-01-07 19:04:15 -06:00
Cameron Gutman
9ffe5218d5 Hoist the logic to keep an AVFrame reference up to Pacer 2026-01-07 17:50:43 -06:00
Cameron Gutman
ed98f256e8 Fix typo 2026-01-06 02:14:45 -06:00
Cameron Gutman
8aec35a650 Allow primary planes to be overlays for video underlays 2026-01-06 02:12:32 -06:00
Cameron Gutman
a3237b741c Support underlay planes by turning off unused active planes 2026-01-06 01:59:34 -06:00
Cameron Gutman
377409f313 Fix oversized DRM dumb buffer for 4:2:0 uploads 2026-01-06 00:49:49 -06:00
Cameron Gutman
80ddd5ba13 Fix software upload for DRM renderer with non-720p resolutions
The buffer allocated for the 720p test frame was left around
and we would attempt to reuse it even if the stream had frames
of a different size.
2026-01-06 00:35:36 -06:00
Cameron Gutman
4a547eb05e Add fourcc_mod_is_vendor() definition for older headers 2026-01-05 23:00:31 -06:00
Cameron Gutman
1c6ed8f390 Remove atomic test-only commit
This is currently race-prone because nothing is synchronizing
between other Qt and SDL uses of DRM master, so it can cause
false negatives if we can't retake master ourselves.
2026-01-05 21:50:31 -06:00
Cameron Gutman
0a58af4fa1 Allow plane selection overrides using environment variables 2026-01-05 21:27:52 -06:00
Cameron Gutman
50a094c917 Fix percentage math 2026-01-05 21:01:23 -06:00
Cameron Gutman
d14cf984f4 Print flip stats after the DrmRenderer is destroyed 2026-01-05 20:52:53 -06:00
Cameron Gutman
13d9d79fe3 Implement support for adjusting zpos to make planes visible 2026-01-05 20:39:12 -06:00
Cameron Gutman
70d4f24455 Fix pending frame leak on destruction 2026-01-05 19:15:58 -06:00
Cameron Gutman
705cd3ddc4 Allow rendering to a cursor plane via opt-in
This is required for some Rockchip devices running vendor kernels.
2026-01-05 19:08:22 -06:00
Cameron Gutman
ea5b062da3 Set VRR, BPC, and content type properties 2026-01-05 18:58:21 -06:00
Cameron Gutman
e6f41f5574 Improve DRM renderer plane compatibility testing
For atomic drivers, use a test-only commit to fully exercise the
path that we will be using when rendering.

For legacy drivers, mask the variable portion of Broadcom modifiers
before matching with IN_FORMATS.
2026-01-05 18:20:39 -06:00
Cameron Gutman
9af6222039 Update moonlight-common-c to fix leak 2026-01-05 00:24:16 -06:00
Cameron Gutman
476414ea71 Fix a rare race where an overlay surface can leak 2026-01-04 22:29:12 -06:00
Cameron Gutman
83d770cdba Prefer BT2020_YCC to allow chroma subsampling 2026-01-04 22:16:52 -06:00
Cameron Gutman
25e2d39e26 Fix copy-paste mistake in 8726c1 2026-01-04 21:52:12 -06:00
Cameron Gutman
bd32370b6d Fix libdrm return value vs errno confusion
libdrm is inconsistent between returning -1 with an errno set
and just returning -errno as the return value. Figuring out which
behavior a given libdrm function has require reading the source :/
2026-01-04 21:50:40 -06:00
Cameron Gutman
8726c1c7d0 Bring back atomic async page flip support
Now that we're referencing the AVFrame to keep the buffers from
being reused during scanout, this should hopefully work better.
2026-01-04 19:34:13 -06:00
Cameron Gutman
34881599f5 Reference the AVFrame while the backing DMA-BUFs are used for scanout
This prevents tearing and other artifacts caused by the decoder
writing to a DMA-BUF that is currently being displayed.
2026-01-04 18:47:00 -06:00
Cameron Gutman
de0fb72424 av_buffer_create() copies the pointer not the data 2026-01-04 18:24:20 -06:00
Cameron Gutman
46c76534bc Use AVBufferRefs to keep EGLImages and DRM FDs around for the lifetime of the frame 2026-01-04 18:06:24 -06:00
Cameron Gutman
67cba9e397 Add branding colors to appstream metadata 2026-01-04 00:38:54 -06:00
Cameron Gutman
2ab72375c6 Fix additional appstream metadata linter warnings 2026-01-04 00:16:20 -06:00
Sabri Ünal
d3118bd677 metadata: Tidy up
- Drop categories that are already provided by the desktop file
- Group important information together
- Add vcs-browser URL to point to the source code repository
2026-01-03 23:56:03 -06:00
Cameron Gutman
b8c3658c42 Skip modifier check if the frame doesn't have any modifiers 2026-01-03 02:53:44 -06:00