Commit Graph

31 Commits

Author SHA1 Message Date
bjorn3 de0239d3ed inputd: Automatically switch to first vt once created 2025-03-02 16:33:39 +01:00
bjorn3 4f2268bbfe graphics/vesad: Exit gracefully when there is no boot framebuffer 2025-03-01 19:54:33 +01:00
bjorn3 68af18aead graphics/vesad: Make some fields and methods private 2025-03-01 18:23:31 +01:00
bjorn3 91f814a42c graphics/vesad: Simplify sync loop
LLVM should optimize it to pretty much the same code, but using a
regular for loop makes it's behavior clearer.
2025-03-01 18:22:18 +01:00
bjorn3 0c42f431bd graphics/vesad: Merge screen.rs into scheme.rs 2025-03-01 18:09:23 +01:00
bjorn3 5fc04c332d graphics: Move Damage from inputd to graphics-ipc 2024-12-28 16:26:18 +01:00
bjorn3 5af43fcaa2 graphics/vesad: Merge OffscreenBuffer into GraphicScreen 2024-12-28 14:51:02 +01:00
bjorn3 9afe3b390b graphics/vesad: Remove all usage of unstable features 2024-12-27 15:57:43 +01:00
bjorn3 ed9ad1aaf1 graphics/vesad: Remove old resizing code
Graphics clients will need to handle resizing themself anyway for
handoff between graphics drivers and as such don't need the graphics
to modify the framebuffer during resize.
2024-12-27 15:57:18 +01:00
bjorn3 d2f1af9ca7 Add driver-graphics crate
This unifies the driver interface handling between graphics drivers and
makes it easier to change all graphics drivers in lockstep when adding
new features.
2024-12-27 12:47:43 +01:00
bjorn3 8eabb75524 Update redox-scheme to 0.3.0 2024-12-26 15:50:30 +01:00
bjorn3 a88f2c4b53 graphics/vesad: Remove support for reading resize events
Nobody actually listens for them from vesad itself anyway. Instead they
listen for them from inputd.
2024-12-24 14:49:42 +01:00
bjorn3 db9ee0a495 vesad: Fix damage clipping
oops
2024-12-23 21:29:57 +01:00
bjorn3 f6cc7d25df graphics: Unify damage clipping 2024-12-23 19:02:24 +01:00
bjorn3 f2156d4654 graphics: Optimize the damage buffer api
It is now possible to write multiple damage locations in a single write
call. Vesad also no longer processes damage for background vt's. The
entire framebuffer will be redrawn once the vt switches to the
foreground anyway. And finally fsync now consistently redraws the entire
screen rather than having different behavior between vesad and
virtio-gpud.
2024-12-23 19:02:24 +01:00
bjorn3 4c4ab2de44 graphics: Implement handoff from vesad to virtio-gpud
With this virtio-gpud no longer has to support getting deactivated at
any time to hand back control to vesad. This makes it much easier to add
many new features that a proper graphics driver is supposed to support.

Be aware that virtio-gpud waits for the vsync on every flush request.
Fbcond and orbital are not really happy about this right now and when
something changes multiple times within a single frame, flush requests
queue up, causing the ui to hang until all flush requests are finished.
It is still possible to switch to another VT though which won't hang.
2024-12-23 18:59:18 +01:00
bjorn3 5f7ee8f646 Use inputd's Damage everywhere instead of separate SyncRect types 2024-12-22 19:48:27 +01:00
bjorn3 8e92e2c743 inputd: Let graphics drivers pull vt activation events from inputd
Previously inputd would directly push vt activation events to the
graphics driver, which required being quite lazy to prevent deadlocks as
well as the graphics driver having a location where events can be pushed
to. By having graphics drivers pull the vt activation events instead,
the effective control flow becomes simpler and it becomes easier to
correctly handle multiple graphics drivers on the system. For example it
becomes possible for multiple graphics drivers to present displays for a
single VT as well as making it easier to provide a handoff from the
early framebuffer to a real graphics driver.
2024-12-22 17:18:24 +01:00
bjorn3 273cbda872 inputd: Split ControlHandle and DisplayHandle
ControlHandle is used to switch the active vt, while DisplayHandle is
used by display drivers to register new vt's. There are entirely
unrelated tasks and the fact that they had been merged together has been
confusing me for a while.

Also changed activating a VT to no longer create a new vt when none
existed previously. The target graphics driver may not be able to handle
the new VT. inputd -A already didn't allow activating non-existent VT's
as it first tried to open a consumer handle for the target VT.
2024-12-22 16:46:02 +01:00
bjorn3 7565720f34 vesad: Migrate to redox-scheme 2024-12-22 16:43:17 +01:00
bjorn3 66c1d0fd88 Tell the kernel to disable graphical_debug right before the first framebuffer write by userspace
Also remove the framebuffer clear in FrameBuffer::new as the entire
framebuffer will be overwritten anyway almost immediately after.
2024-07-24 21:06:29 +02:00
bjorn3 2e341fa742 Directly pass FrameBuffer to redraw and sync
This avoids creating an intermediate &'static mut [u32] of questionable
soundness and simplifies the code a bit.
2024-07-19 22:18:34 +02:00
bjorn3 53c02b5322 Move the framebuffer resizing code into a FrameBuffer method 2024-07-19 22:12:48 +02:00
bjorn3 857773393d Ensure fields of SyncRect are not reordered
Without repr(C), repr(packed) technically allows reordering fields.
2024-07-19 21:56:56 +02:00
bjorn3 ef29520cf5 Avoid ptr2int2ptr casts in GraphicScreen::sync
Also use pointer arithmetic on *mut u32 over manual multiplication by 4.
The ptr2int2ptr casts pessimize optimizations.
2024-07-19 21:55:21 +02:00
bjorn3 747898dfb2 Run rustfmt on the entire graphics subsystem 2024-07-19 21:24:48 +02:00
bjorn3 ebb2243538 Remove all traces of VtMode
It isn't used anywhere anymore.
2024-07-19 21:18:09 +02:00
Jacob Lorentzon ff956fd3bb Switch to libredox where applicable (fixed) 2024-03-18 22:09:25 +00:00
Jeremy Soller 98078650f8 Revert "Switch to libredox where applicable."
This reverts commit 2e7dbf1cc1.
2024-03-18 15:00:52 -06:00
4lDO2 2e7dbf1cc1 Switch to libredox where applicable. 2024-03-18 19:23:05 +01:00
bjorn3 887412daf5 Move all graphics related drivers to graphics/ 2024-02-29 15:41:05 +01:00