Replaces the clamp-and-crop fix from 14a6f2a9 with the real fix: when
the display controller is hardware-scaling a plane at scanout (its
CRTC destination rect differs from the plane's native buffer size --
e.g. a game's native-resolution exclusive-fullscreen swapchain
stretched to fill a higher-resolution output), kmsgrab's raw DMA-BUF
import bypasses that scaler entirely and only ever sees the pre-scale
buffer. Reproduce the same upscale with a linear-filtered
glBlitFramebuffer into a scratch texture sized to the configured
capture resolution, before the existing GetTextureSubImage readback,
so the captured frame matches what the display actually shows instead
of being cropped to the plane's native corner.
The scratch texture/FBOs are lazily created on first use and reused
across frames; the common case (plane already fills the output, no
scaling needed) is unaffected and takes the same path as before.
Untested against real hardware in this session -- built by
cross-referencing this project's own glad config (gl:compatibility=4.6,
confirming BlitFramebuffer/GL_READ_FRAMEBUFFER/GL_DRAW_FRAMEBUFFER are
generated) and the existing FBO helper patterns already used elsewhere
in this file, but needs a live test to confirm the blit against an
EGLImage-backed source texture behaves as expected on this driver.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
display_ram_t::snapshot() read GetTextureSubImage() using the CRTC's
output viewport dimensions, not the imported plane texture's actual
size. These differ when the display controller hardware-scales a
plane at scanout (e.g. a game's native-resolution exclusive-fullscreen
swapchain stretched to fill a higher-resolution output) -- kmsgrab
imports the plane's raw pre-scale buffer via DMA-BUF, bypassing the
CRTC scaler entirely, so the texture is the smaller native size while
the destination buffer is sized for the full output. Reading past the
texture's real bounds triggered GL_INVALID_VALUE every frame, which
manifested as a black screen for the whole scaled-plane session via
the existing import-failure fallback (the "Failed to bind EGLImage"
log line was a stray error from this call, not the import itself).
Clamps the read to the texture's real dimensions and uses
GL_PACK_ROW_LENGTH so a smaller read still lands correctly in the
destination buffer's top-left corner instead of shearing across rows.
This does not reproduce the hardware scaling itself -- the rest of the
frame is left as whatever the buffer previously contained -- but it
resolves the crash/black-screen and captures the correct content at
its native resolution.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
import_source() still logged at error level on every failed frame even
after the round-1 fallback started rate-limiting the caller-side
warnings, since the function has no memory of prior calls. Downgrade
those internal logs to debug (callers already surface a rate-limited,
actionable warning) and add a debug-level dump of the exact surface
descriptor (fourcc, modifier, per-plane fd/offset/pitch) on failure, to
compare against the real buffer's attribs when the import genuinely
fails. Also check eglGetError() after a successful eglCreateImage(),
not just after a null return.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
kms_display_names() and display_t::init() each independently counted
every active, non-cursor plane as one "monitor" when building/matching
the display index. A CRTC with more than one simultaneously-active
plane (e.g. gamescope's base + overlay layers) was counted twice by
both passes, throwing their indices out of sync with each other and
producing duplicate/misnumbered display names.
Track counted CRTCs per card in both passes so a CRTC contributes to
the index exactly once, regardless of how many active planes it has.
* build(deps): bump third-party/lizardbyte-common
Bumps [third-party/lizardbyte-common](https://github.com/LizardByte/lizardbyte-common) from `06cd442` to `011ad2b`.
- [Release notes](https://github.com/LizardByte/lizardbyte-common/releases)
- [Commits](06cd442b80...011ad2bb13)
---
updated-dependencies:
- dependency-name: third-party/lizardbyte-common
dependency-version: 011ad2bb139083dcf4ec21f9c09f07470891a668
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
* style: run clang-format across C++ sources
Reformatted conditionals, loops, and long function calls across core, platform, NVENC, and test helper code to match updated formatting rules, including minor spacing normalization in type declarations. These are style-only edits with no intended behavior changes.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
* chore(deps): update dependency vue to v3.5.40
* Add @vue/server-renderer lock entry
Updates package-lock.json to include @vue/server-renderer@3.5.40 and its Vue SSR runtime dependencies, keeping the lockfile in sync with the installed dependency graph.
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>