Commit graph

345 commits

Author SHA1 Message Date
0aba5246b5
nix: separate overlay with deps 2026-03-02 16:11:18 +02:00
25496568e4
treewide: alejandra -> nixfmt 2026-03-02 16:11:18 +02:00
Deepak Meena
1dbbba659c
drm: fallback to first render node for non-standard buses (#237)
Signed-off-by: Deepak Meena <who53@disroot.org>
Co-authored-by: Tom Englund <tomenglund26@gmail.com>
2026-02-28 15:27:25 +00:00
fazzi
1aa8490166
drm/renderer: glFlush when clearing buffers (#252) 2026-02-27 10:35:28 +00:00
Tom Englund
7f9eb08770
output: add a pendingPageFlips() method (#251)
add a way to get if there are pending pageflip so the compositor can
delay its commits.
2026-02-20 17:56:11 +00:00
Tom Englund
ed26bdbab9
drm: reduce duplicated code in render creation (#247)
initMgpu already does build gl formats so remove the temp creation of
allocator and renderer in onReady() that only built glformats,
also if guard the creation of renderers and allocators to make it less
likely to recreate one that is already existing.
2026-02-19 00:26:56 +00:00
Matt Prestlien
6d0209205a
drm: re-send HDR metadata blob on modeset (#250)
After a VT switch or sleep/resume, the kernel discards all DRM property
blobs. restoreAfterVT() rebuilds the atomic commit with the in-memory
HDR metadata, but prepareConnector() skips blob creation because
STATE.committed (the "what changed" bitmask) was cleared after the last
pre-sleep commit.

During a modeset the kernel state is fully reset, so all properties must
be re-sent regardless of the committed flags. Add a data.modeset guard
to bypass the committed check, matching how max_bpc, colorspace, and VRR
are already handled unconditionally.

The existing has_value() check prevents false positives: non-HDR
modesets (resolution changes etc.) don't populate data.hdrMetadata, so
the block is still skipped.
2026-02-17 13:52:38 +00:00
Lee Bousfield
8a0eb4f0a7
drm/renderer: split input and output buffer attachments (#249) 2026-02-17 13:51:31 +00:00
Tom Englund
603f5cdd42
drm: make pageflips drive the frames (#241)
make the pageflips drive the frames instead of waiting on the idle
dispatch, it adds unnecessery latency at the beginning of each frame.
2026-02-15 21:47:41 +00:00
André Silva
a494d50d32
backend: fix use-after-free of logger during teardown (#244) 2026-02-12 11:24:34 +00:00
Andrei Sabalenka
b2f6c1a838
drm: keep secondary renderers alive only when they're needed (#239)
Currently aquamarine initializes all the secondary renderers and keeps them alive all the time, even when no output on that GPU is enabled. Keeping a secondary renderer alive prevents unused GPU from powering down completely, which e.g. makes battery life significantly worse on Optimus laptops with DP/HDMI ports wired to dGPU.

This patch initializes secondary renderers only when at least one connected output is enabled, and deinitializes them when no enabled outputs remain.
2026-02-12 01:05:18 +00:00
Kevin McConnell
b91f570bb7
drm: ignore redundant tiled display connectors (#238)
Some high-resolution displays (e.g. Apple Studio Display 5K) expose
multiple DRM connectors in a tile group. However, when the driver
handles tiling internally, a single connector will advertise the full
panel resolution, and its other connectors will be inoperative and
redundant.

To avoid ghost outputs from those dead tiles, we can filter out any
tiles where there is a connector in that group that offers the full
resolution by itself.
2026-02-06 21:01:40 +00:00
Deepak Meena
35fa4a965e
drm: use parent device matching for render nodes (#235)
* drm: use parent device matching for render nodes

Signed-off-by: Deepak Meena <who53@disroot.org>

* Revert "rendernode: dont bother finding one on evdi"

This reverts commit 81a0ddf42f.

---------

Signed-off-by: Deepak Meena <who53@disroot.org>
2026-02-04 01:01:29 +00:00
Tom Englund
2455556b42
drm: minor AMS fixes (#229)
* atomic: properly check min max bpc values

properly use maxBpcBounds[0] and clamp it in getMaxBpc. lets not go
below or beyond what HW supports.

* atomic: actually set blobid in prepareGammaBlob

set blobid to zero and not the local copied pointer.

* atomic: add hdr blob to apply and rollback aswell

add missing hdr blob to apply and rollback.

* drm: dont leak modeinfo

free currentModeInfo when done with it.
2026-01-31 13:39:54 +00:00
Tom Englund
af4c6fedbe
renderer: set EGL_CONTEXT_RELEASE_BEHAVIOR_KHR if supported (#234)
EGL_CONTEXT_RELEASE_BEHAVIOR_KHR determines what happends with implicit
flushes when context changes, on multigpu scenario we change context
frequently when blitting content. while we still rely on explicit sync
fences, the flush is destroying driver optimisations.

setting it to EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR essentially mean
just swap context and continue processing on the next context.
2026-01-30 19:42:14 +00:00
Tom Englund
def5e74c97
backend: read idle timer (#233)
* backend: read idle timer

the manpage for timerfd_create and read states this.

timefd_create creates a new timer object, and returns a file descriptor
that can be used to read the number of expirations that have occurred.

The FD becomes readable when the timer expires.

read removes the “readable” state from the FD.

so most likely it has somewhat worked because of the updateIdleTimer()
function.

* backend: check if fd is readable log otherwise

ensure we dont accidently trigger some blocking read call on a non
readable fd, log an error if this occurs, else read it.
2026-01-26 11:59:18 +00:00
Tom Englund
534c88e2f2
drm/formats: add drmModifierToName and print names (#230)
* modifiers: add drmModifierToName and print names

makes it easier to parse logs.

* modifiers: print both uint and name

print both the uint and name
2026-01-06 00:02:53 +01:00
Maxime Nordier
b8a0c5ba5a
libinput: fix pad groups not being ref'd (#227)
Without refing pad groups they would get destroyed when the current
event gets out of scope, causing a segfault when destroying a
CLibinputTabletPad.
2025-12-29 17:15:02 +01:00
Tom Englund
96b53bcb42
output: fix degammalut typo (#226)
dont overwrite gammalut when setting degammalut
2025-12-28 13:34:24 +01:00
Mason Davy
d83c97f8f5
drm: remove an unnecessary reset after VT switching (#223)
I've tested DPMS and different monitor modes with this change, and
everything seems to be working exactly as expected.
2025-12-16 15:56:36 +00:00
Molyuu
c6354f54f9
drm: convert vd path before compare with explicit device path (#222)
FreeBSD always returning symbolic links '/dev/dri/card*' pointed to '/dev/drm/*',
so output device will never be found if `AQ_DRM_DEVICES` is set as explicit devices
path is converted to canonical file path.
2025-12-13 16:40:59 +00:00
a43bedccec
backend: move logger to backend 2025-12-02 22:20:51 +00:00
zacoons
561ae7fbe1
backend: add freeDrmDevice on error in initDmabuf (#221)
This may have caused a small memory leak in some cases.
2025-11-28 22:58:30 +00:00
a20a0e67a3
version: bump to 0.10.0 2025-11-23 18:33:09 +00:00
23e4e25dd3
backend: implement hyprutils' cli::logger 2025-11-23 16:57:12 +00:00
André Silva
6d0b356758
drm: prevent nullptr deref during DRM backend shutdown (#218) 2025-11-05 15:31:59 +00:00
Tom Englund
62479232aa renderer: drop the mods.empty() check
what if the driver did return modifiers that isnt linear, this wont be
added because of the .empty check.
2025-10-25 20:34:59 +01:00
Tom Englund
79b515fc44 renderer: use array and EGLint in creating image
lets use array and eglint in creating eglimage reduces vector
reallocations and unnecessery casting of data.
2025-10-25 20:34:59 +01:00
1826a99238
wayland: send commit after frame 2025-10-10 14:06:57 +01:00
jaro
3b3d8a8bde
drm: ensure disconnect called for removed connectors (#215)
Originally disconnected monitors were not removed from hyprland
correctly and duplications were created when an external monitor was
reattached leading to invalid behavior when switching
(empty desktop is visible).

Now removed monitors are explicitly disconnected during connectors
scanning.
2025-10-07 13:44:35 +02:00
Tom Englund
81a0ddf42f rendernode: dont bother finding one on evdi
evdi/displaylink devices doesnt give us a rendernode at all, and asahi
was hard to associate if a rendernode was related to the
displaynode/card so we fallback to just first found if that occurs.
might be more appropiate to figure out a proper way to deal with these
cases then workaround ever single driver that doesnt give rendernodes
but so far seems only to be evdi.

problem that occured is a 3 gpu situation, the evdi card ended up using
a rendernode for a complete different gpu because it fallbacked to that.
2025-10-06 13:04:33 +02:00
655e067f96
version: bump to 0.9.5 2025-10-03 14:58:18 +01:00
Vaxry
11406cc23a
backend: add a null backend (#209)
Adds a null backend. A null backend doesn't do anything, but allows us to use e.g. the GBM allocator and swapchains by manually passing a drm fd
2025-09-19 19:21:29 +02:00
81584dae2d version: bump to 0.9.4 2025-08-23 12:55:32 +02:00
25fba03140
flake.lock: update hyprutils 2025-08-22 10:56:54 +03:00
adb34ed5e3
nix: make mold optional 2025-08-22 10:49:22 +03:00
Tom Englund
50637ed23e
drm: revert #203 and half of #202 (#204)
either there is a fd going wrong here or certain drivers just plain
fails with this. revert for now. but leave the cdrmrenderer using
rendernode.
2025-08-19 20:44:40 +01:00
Tom Englund
84d53cadf8
drmdumb: reopen displaynode (#203)
if the backends now gets a rendernode it wont call the authmagic on the
displaynode making dumb buffer creation failing on certain drivers. so
reopen it again in the creation of the CDRMDumbAllocator.
2025-08-17 20:16:10 +01:00
98968ac769 version: bump to 0.9.3 2025-08-17 16:13:30 +02:00
Tom Englund
498f46686d
renderer: use rendernode if available (#202)
* renderer: use rendernode if available

init the CDRMRenderer on the rendernode if available otherwise fallback
to the displaynode.

* backend: use rendernode if available

use rendernode if available for the backends, or fallback to display
node. make cdrmrenderer use backend fd.
2025-08-12 17:06:31 +01:00
Lee Bousfield
be166e11d8
gbm: Default to forcing linear blit for multigpu (#197) 2025-07-22 22:26:59 +02:00
Tom Englund
f0db9b7eed
core: introduce drmRenderNodeFD() (#193)
make a getter for drmRenderNodeFD() so we can create sync timelines on
the rendernode on devices not supporting fences on the card* device
directly.
2025-07-21 20:57:00 +02:00
Maxime Nordier
141a991678
libinput: handle tablet axis on proximity, tip and button events (#194)
There can be axis changes on other tablet events, so we need to handle
axis changes on proximity, tip and button events too.
2025-07-19 16:46:21 +02:00
e31b575d19
version: bump to 0.9.2 2025-07-17 11:11:11 +02:00
Tom Englund
dfe9601119
allocator: workaround linear blitting (#174)
so nvidia as main gpu cant create linear modifiers and will give us a null
bo if forced to linear, meanwhile without linear modifiers blitting
fallbacks to cpu copying that is slow. so force linear mods, try create
bo and if all else fails try again without. this way intel/amd as main
and nvidia as dgpu will create linears and if nvidia is main it will be
using cpu copying and still work but a bit slow.

hide all of this behind AQ_FORCE_LINEAR_BLIT env var. since its a bit
hackish.
2025-07-09 14:40:09 +02:00
Tiago Dinis
8b22613953
hdr: don't skip setting up HDR even when the modes are the same (#188)
* hdr: don't skip setting up HDR even when the modes are the same

* i hate c++
2025-07-09 11:18:54 +02:00
Tom Englund
d04e01e70c
core: use -Wpedantic and fix warnings (#187)
* core: use -Wpedantic and fix warnings

dont use anonymous structs, iso c++ forbids it. compound literals is a
c99 thing use designated c++20 initializing instead.

* flake.lock: update

* core: rename .bits to .values

make the name more appropiate to its usage.

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2025-07-08 12:25:39 +02:00
664b2766bc
version: bump to 0.9.1 2025-07-07 17:58:11 +02:00
c1fb82dd3e
backend: don't use a shorthand for SP
fixes build with hl
2025-07-07 17:57:50 +02:00
Tiago Dinis
e2e3f8b4d8
drm: Avoid unnecessary modeset (fixed) (#184)
* feat: only do modeset when the mode is different from the current one

* style: remove braces around 1-line if

* fmt: run clang-format

* drm: add reset function back and remove reset from start

* drm: fix dpms on fastboot

* fmt: run clang-format

* Update Atomic.cpp
2025-07-07 16:19:52 +02:00