Commit graph

29340 commits

Author SHA1 Message Date
Liav A
f476b49fd8 Kernel/Graphics: Merge VirtIO GraphicsAdapter and VirtIO GPU code
A VirtIO graphics adapter is really the VirtIO GPU, so the virtualized
hardware has no distinction between both components so there's no
need to put such distinction in software.

We might need to split things in the future, but when we do so, we must
take proper care to ensure that the interface between the components
is correct and use the usual codebase patterns.
2021-10-27 07:57:44 +03:00
Liav A
a9538b5879 Kernel/Graphics: Convert type method => bool vga compatible method
We never used that type method except in initialization in
GraphicsManagement, and we used it there to query whether the device is
VGA compatible or not.
2021-10-27 07:57:44 +03:00
Liav A
fb0ed2ae46 Kernel/Graphics: Force VirtIO Framebuffer to inherit FramebufferDevice
The distinction is not justified because a VirtIO Framebuffer device
acts much more like a regular FramebufferDevice than a pure BlockDevice.
2021-10-27 07:57:44 +03:00
Liav A
4815282a5f Kernel/Graphics: Rename VirtIO FrameBufferDevice => FramebufferDevice 2021-10-27 07:57:44 +03:00
Luke Wilde
fb321bad35 LibWeb: Implement URLSearchParams.getAll 2021-10-26 23:11:57 +02:00
Linus Groh
09d1db5afd LibJS: Clarify mathematical types in Temporal AOs and functions
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/e480d40
2021-10-26 23:10:11 +02:00
Felix Rauch
30c39e0e41 LibWeb: Fix inline blocks swallowing trailing whitespace
In #10434 an issue with leading whitespace in new lines after
a <br> element was fixed by checking whether the last fragment
of LineBox is empty.

However, this introduced a regression by which whitespace following
inline elements was swallowed, so `<b>Test</b> 123` would appear
like `Test123`.

By asking specifically if we are handling a forced linebreak
instead of implicity asking for a property that may be shared by
other Node types, we can maintain the correct behavior in regards
to leading whitespace on new lines, as well as trailing whitespace
of inline elements.
2021-10-26 17:27:04 +02:00
Sam Atkins
7426feacf7 Base: Map numpad '.' key to '.' instead of ',' in en-GB keymap 2021-10-26 16:51:42 +02:00
Idan Horowitz
4f1d45705f Demos: Remap mouse button events to physical buttons in MouseDemo
This ensures we paint the left button as clicked when the left mouse
button is pressed (and vice-versa with the right one) when the right
mouse button is set as the primary one in the mouse settings.
2021-10-26 16:51:29 +02:00
Idan Horowitz
14223a9c20 Demos: Change MouseDemo's window title to "Mouse demo"
The previous title ("Mouse button demo") didn't fit in the window's
titlebar, which looked pretty bad.
2021-10-26 16:51:29 +02:00
Andreas Kling
e0f0b6379a Kernel: Make WorkQueue::WorkItem slab allocated 2021-10-26 10:50:44 +02:00
Andreas Kling
44b273f3ac Kernel: Use SpinlockProtected<T> in WorkQueue 2021-10-26 10:44:10 +02:00
Andreas Kling
b443e9e1a9 Kernel: Use a larger kmalloc chunk size on 64-bit platforms
This reduces test-js runtime by over 40% on my machine.

(And once again we find another way to defer writing a better kernel
heap allocator..)
2021-10-26 10:38:35 +02:00
Andreas Kling
25250590d0 Kernel: Take VMObject lock once in Region::remap_vmobject_page()
We were taking and releasing the lock repeatedly instead of holding it
across the entire remap operation.
2021-10-26 09:03:41 +02:00
Andreas Kling
821c80848f LibC: Remove debug spam from openpty() 2021-10-26 08:47:06 +02:00
Andreas Kling
fac6d220c3 WindowServer: Don't re-open screen device immediately after opening it
The Screen constructor already calls open_device(), so there's no need
to call it again right after creating a new Screen in apply_layout().

This makes the first screen compose happen ~50ms earlier on my machine.
2021-10-26 01:00:54 +02:00
Andreas Kling
693423bbe8 WindowServer: Remove Screen::init()
This function only did one thing: call Screen::set_resolution().
We always call that function when opening the underlying device anyway,
so this was completely redundant.

This makes the first screen compose happen ~60ms earlier on my machine.
2021-10-26 01:00:54 +02:00
Andreas Kling
47c140610d AK: Prefix debug log messages with current-time-since-boot
This is very helpful when trying to better understand how long certain
things take. :^)
2021-10-26 01:00:54 +02:00
Andreas Kling
0592f80186 Kernel: Add TimeManagement::is_initialized()
This allows clients to check whether TimeManagement is available before
trying to ask it about time related things.
2021-10-26 01:00:54 +02:00
Ben Wiederhake
bf88adbcb6 Kernel: Avoid allocation when checking for vmmouse 2021-10-25 23:38:28 +02:00
Ben Wiederhake
3d855a801b SystemServer: Rename 'BootModes' config option to 'SystemModes' 2021-10-25 23:38:28 +02:00
Ben Wiederhake
8d13f6ddce Kernel+SystemServer: Change bootmode to system_mode
'bootmode' now only controls which set of services are started by
SystemServer, so it is more appropriate to rename it to system_mode, and
no longer validate it in the Kernel.
2021-10-25 23:38:28 +02:00
Ben Wiederhake
09432a8241 Kernel: Separate panic behavior from bootmode
Bootmode used to control panic behavior and SystemServer.
This patch factors panic behavior control into a separate flag.
2021-10-25 23:38:28 +02:00
Ben Wiederhake
542a88a7be Kernel: Separate framebuffers from bootmode
Bootmode used to control framebuffers, panic behavior, and SystemServer.
This patch factors framebuffer control into a separate flag.
Note that the combination 'bootmode=self-test fbdev=on' leads to
unexpected behavior, which can only be fixed in a later commit.
2021-10-25 23:38:28 +02:00
Leandro Pereira
314b8a374b SoundPlayer: Implement playlist shuffle mode
The shuffling algorithm uses a naïve bloom filter to provide random
uniformity, avoiding items that were recently played.  With 32 bits,
double hashing, and an error rate of ~10%, this bloom filter should
be able to hold around ~16 keys, which should be sufficient to give the
illusion of fairness to the shuffling algorithm.

This avoids having to shuffle the playlist itself (user might have
spent quite a bit of time to sort them, so it's not a good idea to mess
with it), or having to create a proxy model that shuffles (that could
potentially use quite a bit of memory).
2021-10-25 23:37:18 +02:00
Leandro Pereira
0812965f50 SoundPlayer: Make M3UParser more idiomatic
Let's use the nice APIs we have, and make the M3U parser a bit more
readable, shorter, and resilient.
2021-10-25 23:37:18 +02:00
Leandro Pereira
3126b78903 SoundPlayer: Fix inconsistencies and code duplication
This is a first pass at refactoring SoundPlayer so that the View widget
is decoupled from the player itself.

In doing so, this fixed a couple of issues, including possibly
inconsistent states (e.g. player could be paused and stopped at the
same time).

With the change, Player actually controls the show, and calls methods
overriden by its subclasses to perform actions, such as update the Seek
bar; the hard work of massaging the raw data is done by the Player
class, so subclasses don't need to reimplement any of these things.

This also removes some copies of playlist management code that happened
to be copied+pasted inside callbacks of buttons -- it now lives inside
a neatly packaged Playlist class, and the Player only asks for the next
song to play.

In addition, the menu bar has been slightly rearranged.
2021-10-25 23:37:18 +02:00
Leandro Pereira
73924f9416 LibCore: Add File::size()
Returns the size in bytes for a file path given its filename. Useful
when file size is needed without having to open the file to query it
using fstat() or seeking to the end.
2021-10-25 23:37:18 +02:00
Leandro Pereira
368e74fdf8 AK: Allow seed value to be specified in string_hash()
For some algorithms, such as bloom filters, it's possible to reuse a
hash function (rather than having different hashing functions) if the
seed is different each time the hash function is used.

Modify AK::string_hash() to take a seed parameter, which defaults to 0
(the value the hash value was originally initialized to).
2021-10-25 23:37:18 +02:00
Daniel Bertalan
5241c5f219 Ports: Enable history handling in bc
An oversight in the TTY defaults caused bc to reach an assertion failure
when it tried to set up raw mode for printing the history.

Now that this is fixed, we can finally enable history handling.
2021-10-25 21:42:26 +02:00
Daniel Bertalan
5f6030b13c Kernel+LibC: Default to 8-bit characters in TTY
Some ports (like `bc` with history enabled) sensibly set the termios
character size to 8 bits.

Previously, we left the character size value (given by the bitmask
CSIZE) as zero by default (meaning 5 bits per character), and returned
ENOTIMPL whenever someone modified it. This was dumb.
2021-10-25 21:42:26 +02:00
Andrew Pardoe
0e68550c05 MouseSettings: Add option to reverse buttons
Add option to reverse primary and secondary buttons in Mouse Settings.
- WindowServer.ini: add default entry
- switch-mouse-buttons.png: new icon for settings entry
- Mouse.gml/MouseWidget.*: new settings dialog
- ClientConnection/WindowManager/Server: window message for settings
- EventLoop.cpp: swap buttons 1 and 2 if settings are on
2021-10-25 19:20:33 +03:00
Andreas Kling
5599d22744 LibJS: Support calling result of a computed MemberExpression in bytecode
This patch adds support for calls of the form o.f[expr]()
2021-10-25 16:05:04 +02:00
Andreas Kling
a2a8b97c11 LibJS: Simplify MemberExpression::generate_bytecode()
Use the get-from-reference helper in BytecodeGenerator.
2021-10-25 16:04:31 +02:00
Andreas Kling
72cd31d033 LibJS: Tweak Value::to_property_key() fast path for Int32
Move the check for Int32 *before* we call to_primitive().
2021-10-25 15:37:28 +02:00
Andreas Kling
cfbb69a9cd LibJS: Support more assignment expressions in the bytecode VM
Use the new reference get/put helpers in BytecodeGenerator to support
assignment expressions other than just plain assignment.
2021-10-25 15:29:52 +02:00
Andreas Kling
72736f9e93 LibJS: Generate bytecode for UpdateExpression with MemberExpression arg 2021-10-25 15:17:41 +02:00
Andreas Kling
1dc60b028f LibJS: Add BytecodeGenerator helpers for reference get/put
This allows code sharing between all AST nodes that want to get and/or
put through a reference.
2021-10-25 15:16:22 +02:00
Andreas Kling
b63d17e2f8 LibJS: Add fast paths for <, >, <=, and >= with Int32 on both sides
This gives us a ~5% speed-up on Kraken's ai-astar.js
2021-10-25 14:35:23 +02:00
Andreas Kling
b4c0e27d26 AK: Always inline Optional::release_value()
This allows the compiler to optimize away the VERIFY(m_has_value) in
many cases.
2021-10-25 14:31:46 +02:00
Andreas Kling
765ed9677b DHCPClient: Simplify DHCPv4PacketBuilder
Instead of creating a temporary ByteBuffer to hold the packet while
building it, we can just create the DHCPv4Packet struct directly.
2021-10-25 14:31:11 +02:00
Andreas Kling
d203a86900 LibJS: Always inline the bytecode instruction iterator's operator++ 2021-10-25 13:37:02 +02:00
Andreas Kling
a97d75bb63 LibJS: Add default constructor for PrivateName
This avoids a round-trip through FlyString("") for every Reference.
2021-10-25 13:29:44 +02:00
Andreas Kling
b2f15537bb AK: Add fast path for constructing StringImpl from "" literal 2021-10-25 13:29:44 +02:00
Brendan Coles
518b8fb292 Ports: Bump bc from version 2.5.1 to 5.1.1 2021-10-25 13:01:40 +02:00
Karol Kosek
d40c36a16e Assistant: Fix adding sequential bonus in Fuzzy Match
It was comparing if they both had the same index position (which was
always false).
2021-10-25 13:00:32 +02:00
Karol Kosek
5e10cd364b Assistant: Save match all match points in Fuzzy Match
From what I think, the array should consist of point indexes that have
been matched instead of just the last one.

For example, these are the array contents after searching 'file' for
'File Manager':
- Before: [ 3 ]
- Now: [ 0, 1, 2, 3 ]

Besides that, this greatly improves the scoring logic, as it can now
calculate bonuses.

Closes: #8310
2021-10-25 13:00:32 +02:00
Karol Kosek
e7eccf3de2 Assistant: Simplify the logic of calculating bonus points
This does not change the results, but makes the code clearer.
2021-10-25 13:00:32 +02:00
Karol Kosek
ee17614e34 Assistant: Move score calculation logic to separate function 2021-10-25 13:00:32 +02:00
Karol Kosek
5ddd1555bc Assistant: Make strings const referenced
Found by clazy.
2021-10-25 13:00:32 +02:00