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.
* 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.
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.
* 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>
* 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
* 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.
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.
* 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.
* 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.
* 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.
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.
only scan connected connectors when deciding which gpu to become primary
mux switched laptops still have connectors for internal panel but not
connected.
* 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