Commit graph

294 commits

Author SHA1 Message Date
0bd03a8e26
swapchain: fix age 2025-07-05 13:02:31 +02:00
b3208e82ec
wayland: don't force the swapchain to length 2025-07-05 13:01:27 +02:00
33ebde1c30
drm: revert "Avoid unnecessary modesetting (#183)"
This reverts commit c0c56dde3e.

Breaks dpms
2025-07-04 13:40:05 +02:00
Tiago Dinis
c0c56dde3e
drm: Avoid unnecessary modesetting (#183) 2025-07-03 21:08:03 +02:00
Tom Englund
dc45d00900
drm/renderer: optimize blitting and use gles3 shaders (#179)
* renderer: use gles3 shaders

move over to gles3 shaders.

* renderer: cleanup some code

cleanup some code, use nullptr instead of void zero cast, use empty
instead of .size() and cache last viewport size. dont wait on the waitFd
if its already readable.

* renderer: make sgltex a class

make sgltex a class, cache the textureparameters to not set it twice or
more, and add a bind/unbind function.
2025-06-29 17:20:23 +02:00
dd92142139
core: Use new typed signals from hyprutils (#178) 2025-06-26 23:44:32 +02:00
7cef49d261
CI/Nix: add cache-nix-action
Use nixbuild/nix-quick-install-action which pairs well with
nix-community/cache-nix-action.

Should help with build times by reducing the number of packages needing
to be re-downloaded on each run.

Parameters are taken from https://github.com/nix-community/cache-nix-action
and may be tweaked later.
2025-06-20 01:29:45 +03:00
Friday
94981cf75a
nix: use gcc15 (#176)
also updated dependencies
2025-06-05 21:28:30 +01:00
Tom Englund
560926d3b9
drm: reduce a bit of local temporary copies going around in renderer (#175)
* renderer: const reference dmabufs

const reference dmabufs to avoid local temporaries.

* renderer: make sgltex a unique ptr

make sgltex a uniqueptr and use weak pointers to reference it, reduces a
bit of local temporar copies going around.
2025-05-25 22:29:26 +02:00
Tom Englund
389372c5f4
drm/renderer: depend on gles3 and use vertex array objects (#173)
* drm/renderer: use gles3 vertex array objects

depend on gles3 and use vertex array objects in shaders, and upon drawing
only bind/unbind the vao instead of calling glVertexAttribPointer every blit.

* renderer: ensure same program is used once

ensure we only call glUseProgram on same program once.

* renderer: remove gles2 context creation

we are now using gles3 functions that will not work in a gles2 context,
remove any attempts of using it.

* renderer: move SShader functions to source

move SShader out of gl struct and move createVao and destructor to
source file.
2025-05-21 23:54:09 +02:00
Tom Englund
9d38b6a888
gl: a few small renderer optimisations (#172)
* renderer: remove unnecessery glflushes

dont glflush when its not needed.

* renderer: avoid vector reallocations

avoid vector reallocations by using a fixed size std:array

* renderer: dont call glgeterror unless trace

glgeterror causes overhead and driver synchronisations overhead if
called in hot paths, the GLCALL macro is used in a lot of places, guard
it behind the AQ_TRACE env var. at the cost of less debug output unless
AQ_TRACE is used.
2025-05-19 23:02:30 +02:00
Honkazel
a19cf76ee1
clang-tidy: fix some errors (#166)
* clang-tidy: fix some errors

* ...Eh?
2025-04-22 23:23:23 +02:00
Tom Englund
c8282f4982
atomic: fix compiler warning with string (#164)
the compiler tries to optimize this and inlines the +=, which might involve raw memcpy operations,
and in doing so, it thinks there is a chance that the internal buffer doesnt have enough space.
use ostringstream instead, and return the string from that.
2025-04-10 14:47:15 +02:00
UjinT34
1d2dbd72c2
drm: restore hdr metadata after vt switch (#163) 2025-03-29 17:25:29 +01:00
Lee Bousfield
484b732195
backend: Fix compiler warnings (#160) 2025-03-17 13:07:53 +01:00
1c8fa0bf04 version: bump to 0.8.0 2025-03-16 22:00:48 +00:00
Lee Bousfield
b058847592
backend, allocator: Fix mGPU backend + allocator swapchain combos (#159) 2025-03-16 22:52:24 +01:00
André Silva
bea48d0bbe nix: mesa -> libgbm
d209d800b7
2025-03-14 08:35:25 +02:00
Lee Bousfield
258cfeb3d0
misc: Fix Attachment shared pointer reinterpret (#154) 2025-03-10 18:41:37 +01:00
Lee Bousfield
81498562d0
wayland: Fix backend idleCallbacks destruction (#151) 2025-03-06 18:37:11 +01:00
Tom Englund
b236a43699
drm: only scan connected connectors (#155)
only scan connected connectors when deciding which gpu to become primary
mux switched laptops still have connectors for internal panel but not
connected.
2025-03-04 14:58:38 +01:00
Lee Bousfield
7b5db3d8a2
drm: Add strict typing to attachment manager (#152)
* misc: Add strict typing to attachment manager

* misc: Trim down CAttachmentManager comments

* misc: Return full pointer in attachment manager
2025-03-02 22:32:33 +01:00
Lee Bousfield
09b3fd5932
drm: Fix multi-GPU support for Nvidia (#147)
* allocator: Don't force linear for multigpu if unsupported

* drm: Use an intermediate CPU buffer for blit if necessary

* drm: Add comment and cleanup style a bit

* drm: Fix formatting from comment addition

* drm: Use std::vector and std::span for intermediateBuf

* drm: Fix style and add null check

* drm: Remove TODO about pixel buf format
2025-03-02 03:07:00 +01:00
Lee Bousfield
76508fe1ec
drm: Use RAII to manage EGL context (#150) 2025-02-28 02:32:20 +01:00
Ikalco
e62592f0f4
drm/atomic: fix atomic reset being skipped, check nullptr elsewhere instead (#149) 2025-02-27 15:21:05 +01:00
UjinT34
2ff06343aa
drm: get max bpc from drm format (#146) 2025-02-23 18:33:41 +01:00
f239e5aadd backend: log no allocator errors 2025-02-11 18:27:43 +00:00
Ikalco
a3dda0d10c
drm: prioritize gpus with the most internal panels (#144) 2025-02-09 13:22:25 +01:00
427077ca92
CI: remove deprecated magic-nix-cache-action 2025-02-08 23:12:41 +02:00
Ikalco
ecd2c813e0
drm: only allow multigpu blit to implcit, not all external formats (#143) 2025-02-03 20:40:52 +01:00
Honkazel
343178ba45
core: Compiler fixes and options (#141)
* reorder ctors

* sign-compare

* Add some compile options from Hyprland
2025-02-02 13:46:00 +01:00
UjinT34
257b205079
drm/output: add api to set drm content type property (#140) 2025-02-02 01:42:56 +01:00
Ikalco
95506e561d
egl/drm: consolidate EGL init/state (#138)
* move renderer to EGLRenderer

* consolidate EGL state and initialization

* move over eglSync

* unbreak abi
2025-02-01 16:17:49 +01:00
48a000cf35
flake.lock: update 2025-01-29 22:44:05 +02:00
6934e7dc53 version: bump to 0.7.2 2025-01-28 23:45:26 +00:00
a0553cd65e headless/wayland: emit present events after commit
fixes https://github.com/hyprwm/Hyprland/issues/8087
2025-01-28 23:34:19 +00:00
7fe006981f
flake.lock: update 2025-01-23 14:46:37 +02:00
Ikalco
f0519bfebd
headless: fix headless supported formats (#136) 2025-01-23 01:07:33 +01:00
Honkazel
4edeb99390
core: add clang-tidy (#135) 2025-01-22 22:39:30 +01:00
e7719f9b9f version: bump to 0.7.1 2025-01-12 18:21:56 +01:00
UjinT34
10fb69da79
drm: remove wrong property settings (#133) 2025-01-12 17:03:59 +00:00
Jan Beich
69048021ac
core: Unbreak build with libc++ (#131)
* backend: remove unused headers after 511600133c

* backend: add missing header for libc++ after 03677f8561

src/backend/Backend.cpp:275:42: error: no member named 'find_if' in namespace 'std::ranges'
  275 |     const auto primary    = std::ranges::find_if(implementations, [](SP<IBackendImplementation> value) { return value->type() == Aquamarine::AQ_BACKEND_DRM; });
      |                             ~~~~~~~~~~~~~^
2025-01-11 05:12:51 +01:00
fe8ff219fd version: bump to 0.7.0 2025-01-10 19:52:13 +01:00
maround95
03677f8561
core: GPU hotplug support (#130) 2025-01-10 18:39:08 +00:00
UjinT34
c2369bc3ab
drm: Avoid excessive atomic properties updates (#95)
* do not set cursor planeProps unless smth changed

* do not skip cursor state flag setting

* drm: scan only cards and not outputs, safeguard against null renderer (#106)

* drm: dont scan card outputs

no need to scan for card[0-9]* and probe card0-eDP etc if they are kms,
bootvga and rendernodes etc. skip the wildcard and remove a unused
size_t variable.

* drm: dont commit state if renderer is missing

setting certain env vars to force egl implentations makes the render
creation fail on the second gpu. instead of causing a coredump,
safeguard commitState and let the monitor turn blank instead.

* props: bump version to 0.5.0

* drm: Validate conn before dereference in CDRMAtomicRequest::commit() (#108)

During startup, CDRMAtomicImpl::reset() may emit a call to method
commit of a CDRMAtomicRequest instance with member "conn" uninitialized,
leading to a segfault. Validate the the pointer before dereference it as
a workaround.

Fixes: 55ac962 ("DRM: preliminary atomic support")
Closes: https://github.com/hyprwm/aquamarine/issues/107

Signed-off-by: Yao Zi <ziyao@disroot.org>

* buffer: remove useless forward def

* drm: clearer flow when rescanning connectors (#113)

* consolidates into checkOutput for clearer flow when rescanning connectors

* add error log

* drm: allow multigpu blit from explicit to implicit (#114)

* version: bump to 0.5.1

* flake.lock: update

* flake.nix: gcc13 -> gcc14 (#118)

* drm: udev scan only drm_minor, not connectors (#119)

* drm: log errno set by drmModeAtomicCommit (#120)

* drm: moved null check for renderer to shouldBlit() (#109) (#121)

* drm: only fail INVALID format when enabled (#122)

* flake.lock: update

* drm: only clear buffers when fullReconfigure succeeds (#124)

* core/drm: Add HDR Support (#112)

* version: bump to 0.6.0

* drm: limit udev drm_minor to Linux after a132fa41be (#129)

Not implemented by libudev-devd yet:

[ERR] [AQ] drm: No gpus in scanGPUs.
[ERR] [AQ] drm: Found no gpus to use, cannot continue
[ERR] [AQ] DRM Backend failed

* do not set cursor planeProps unless smth changed

* test separate cursor commits

* do not change hdr blob unless asked to

* rebase

* split atomic commit processing and move hdr & colorspace into modeset

* fix wide color gamut flag & cleanup

* remove unused debug var

---------

Signed-off-by: Yao Zi <ziyao@disroot.org>
Co-authored-by: Tom Englund <tomenglund26@gmail.com>
Co-authored-by: Vaxry <vaxry@vaxry.net>
Co-authored-by: Ziyao <ziyao@disroot.org>
Co-authored-by: Ikalco <73481042+ikalco@users.noreply.github.com>
Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Co-authored-by: Austin Horstman <khaneliman12@gmail.com>
Co-authored-by: Richard Henninger <56615615+richen604@users.noreply.github.com>
Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
2025-01-10 18:38:51 +00:00
Jan Beich
5bc315ed56
drm: limit udev drm_minor to Linux after a132fa41be (#129)
Not implemented by libudev-devd yet:

[ERR] [AQ] drm: No gpus in scanGPUs.
[ERR] [AQ] drm: Found no gpus to use, cannot continue
[ERR] [AQ] DRM Backend failed
2025-01-07 11:35:34 +00:00
4846091641 version: bump to 0.6.0 2025-01-05 19:40:53 +01:00
UjinT34
aeab812e0f
core/drm: Add HDR Support (#112) 2025-01-05 14:44:39 +00:00
Ikalco
f7082bef81
drm: only clear buffers when fullReconfigure succeeds (#124) 2025-01-01 20:36:46 +00:00
eecb74dc79
flake.lock: update 2024-12-23 00:27:26 +02:00