Commit Graph

33 Commits

Author SHA1 Message Date
bjorn3 5fc04c332d graphics: Move Damage from inputd to graphics-ipc 2024-12-28 16:26:18 +01:00
bjorn3 b5eeaed9e1 graphics/virtio-gpud: Use resource size rather than display size in set_scanout
This ensures we use the right size if the display got resized but the
resource hasn't been resized yet.
2024-12-28 14:32:56 +01:00
bjorn3 0b8648ff5b graphics/virtio-gpud: Move some initialization code around 2024-12-28 14:16:56 +01:00
bjorn3 1ef298e576 graphics/virtio-gpud: Remove getters and setters for ResourceCreate2d 2024-12-28 14:04:10 +01:00
bjorn3 1d89ca7bd2 graphics/virtio-gpud: Remove unnecessary VolatileCell
The virtio queue abstraction already provides the necessary
synchronization to make everything data-race free without volatile
accesses.
2024-12-28 14:01:09 +01:00
bjorn3 d7becba023 graphics/virtio-gpud: Don't crash when multiple displays are attached 2024-12-27 15:11:15 +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 b7f4af9bd2 graphics/virtio-gpud: Bring scheme impl closer in line with vesad 2024-12-26 22:19:35 +01:00
bjorn3 1b6feeb7c7 graphics/virtio-gpud: Use VM window size as display size
Rather than hard coding 1920x1080. This doesn't yet handle resizing the
VM window at runtime though.
2024-12-26 20:59:08 +01:00
bjorn3 62f1a80c3e graphics/virtio-gpud: Move resources from Display to GpuScheme
Resources are global for the entire virtio-gpud device, not local to a
single display. In the future resource creation will become entirely
detached from specific displays.
2024-12-26 17:53:45 +01:00
bjorn3 2344206c21 graphics/virtio-gpud: Bundle resource id and resource mapping 2024-12-26 17:36:40 +01:00
bjorn3 8eabb75524 Update redox-scheme to 0.3.0 2024-12-26 15:50:30 +01:00
bjorn3 0019eecadd virtio-gpud: Don't process flush requests for background VT's
This ensures that the foreground VT doesn't lockup if a background VT
spams us with flush requests. In the future we may want to add a
scheduler or collapse redundant flush requests.
2024-12-23 19:02:24 +01:00
bjorn3 025086acd1 virtio-gpud: Add offset method to XferToHost2d
This will hopefully avoid confusion if someone in the future changes the
XferToHost2d in flush to pass a smaller GpuRect. Without adjusting
offset this would cause glitches.
2024-12-23 19:02:24 +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 b9189b91cf virtio-gpud: Couple minor improvements 2024-12-23 13:40:09 +01:00
bjorn3 b0f682c95d virtio-gpud: Handle multiple VT's
The code will become simpler once handoff is implemented such that
virtio-gpud no longer needs to support reset and reinitialization of the
virtio gpu device.
2024-12-23 13:40:09 +01:00
bjorn3 31deddd0d5 virtio-gpud: Claim a new VT
Before these changes virtio-gpud effectively didn't do anything and
vesad's framebuffer was kept instead.
2024-12-23 12:50:41 +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 436a16b069 virtio-gpud: Migrate to redox-scheme 2024-12-22 16:44:27 +01:00
bjorn3 7935ed0248 Deduplicate setup_logging between all drivers
This will make it easier to change the way logging is done for all
drivers. This also fixes the log category for a couple of drivers as
well as makes failing to set the logger a fatal error. Only when a
logger is already set is it impossible to set another logger.
2024-07-24 22:00:40 +02:00
bjorn3 8a91bae0a6 Remove unnecessary unsafe block 2024-07-19 21:25:52 +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
bjorn3 a3b957c2e5 pcid: Fetch config in PciFunctionHandle::connect_default() 2024-06-15 15:16:09 +02:00
bjorn3 fdb9ea816b pcid: Rename PcidServerHandle to PciFunctionHandle 2024-06-15 15:05:59 +02:00
4lDO2 7b2f4dda90 Use scatter-gather list for virtio framebuffer.
The current frame allocator limits requests to powers of two, between 4
KiB and 4 MiB. As such, a 8-bit color 1920x1080 framebuffer needs at
least two allocations.
2024-06-14 08:26:19 +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