Commit graph

50083 commits

Author SHA1 Message Date
Andreas Kling 4399ca2d82 LibWeb: Don't include CSS/CSSStyleDeclaration.h from DOM/Element.h
This required splitting out CSS::StyleProperty into its own file and
out-of-lining Element::layout_node().
2023-05-08 09:29:44 +02:00
Andreas Kling 5b5fbecb38 LibWeb: Don't include DOM/Attr.h from DOM/Element.h
This required moving Element::for_each_attribute() out of line, but that
seems harmless enough.
2023-05-08 09:29:44 +02:00
Andreas Kling 43616316de LibWeb: Don't include CSS/StyleComputer.h from Element.h and Document.h
This made editing StyleComputer.h unpleasant for no reason.
2023-05-08 09:29:44 +02:00
Kemal Zebari 5ba5beb50f Tests: Add more tests for JsonArray
At an attempt to detect future regressions in AK/JsonArray, this
snapshot adds additional tests for it to TestJSON.cpp.
2023-05-08 07:39:49 +01:00
Kenneth Myhra 03ca560b2d Ports: Update dosbox-staging to 0.77.1
This version of 'dosbox-staging' uses the meson build system.

Previous versions of dosbox-staging started in windowed mode with a
resolution of 320x200. This version starts in windowed mode with a
resolution of 640x480.

Audio was stuttering a bit in previous versions, but it sounds like it
might have become a bit worse. This is probably because of higher CPU
usage and the audio server/client not able to keep up.

Added a post_install() section to package script which outputs a link to
dosbox-staging's release notes.
2023-05-08 08:03:31 +02:00
Kenneth Myhra 9541f23376 Ports: Clean up 'package.sh' for dosbox-staging
This makes dosbox-staging's 'package.sh' conform to our coding standards
for bash scripts.
2023-05-08 08:03:31 +02:00
Kenneth Myhra 4eaac2ff1e Ports: Add opusfile 0.12 2023-05-08 08:03:31 +02:00
Kenneth Myhra 748289211a Ports: Add libopus 1.3.1 2023-05-08 08:03:31 +02:00
Ben Wiederhake ac5cef1b66 LibCrypto+LibTLS: Avoid crashing on invalid input
Fixes #18307.
2023-05-08 06:43:28 +02:00
Andreas Kling f37f081f15 LibWeb: Don't relayout when visibility changes between visible/hidden
Layout will be identical for both of those values, so only a repaint is
necessary. If it changes to/from "collapse" however, we do need to
relayout. This means we can't simply use the "affects-layout" mechanism.
We have to write a little bit of custom code.

This makes Google Groups (and surely many other sites) significantly
more responsive by avoiding large amounts of layout work.
2023-05-08 06:42:17 +02:00
Pankaj Raghav 53d47c6614 Documentation: Update information regarding MSIx for NVMe :^)
Now we support MSIx for NVMe. Retain the information about using
nvme_poll until MSIx is tested on a Bare metal system.
2023-05-07 21:16:41 +02:00
Pankaj Raghav 9b3b0531e5 Kernel: Add MSIx support to NVMe
Add MSIx support to NVMe. Prefer MSIx over pin-based interrupts as they
are more efficient and all modern hardware support them.
2023-05-07 21:16:41 +02:00
Pankaj Raghav bfcf7ab3e8 Kernel: Pass NVMeController reference to NVMequeue
This is in preparation for adding MSI(x) support to the NVMe device.
NVMeInterruptQueue needs access to the PCI device to deal with MSI(x)
interrupts. It is ok to pass the NVMeController as a reference to the
NVMeQueue as NVMeController is the one that owns the NVMeQueue.

This is very similar to how AHCIController passes its reference to its
interrupt handler.
2023-05-07 21:16:41 +02:00
Pankaj Raghav 693e3419b7 NVMe: Use an explicit Queue type instead of using an Optional irq
Add an explicit QueueType enum which could be used to create a poll or
an interrupt queue. This is better than passing an Optional<irq>.

This refactoring is in preparation for adding MSIx support to NVMe.
2023-05-07 21:16:41 +02:00
Pankaj Raghav feb48cbc7c Kernel: Introduce PCIIRQHandler
PCIIRQHandler is a generic IRQ handler that the device driver can
inherit to use either Pin or MSI(x) based interrupt mechanism.

The PCIIRQHandler can do what the existing IRQHandler can do for pin
based interrupts but also deal with MSI based interrupts. We can
hopefully convert all the PCI based devices to use this handler so that
MSI(x) can be used.
2023-05-07 21:16:41 +02:00
Pankaj Raghav 82cf0bfb75 Kernel: Add APIs to PCI Device to use MSI(x)
Add reserve_irqs, allocate_irq, enable_interrupt and disable_interrupt
API to a PCI device.

reserve_irqs() can be used by a device driver that would like to
reserve irqs for MSI(x) interrupts. The API returns the type of IRQ
that was reserved by the PCI device. If the PCI device does not support
MSI(x), then it is a noop.

allocate_irq() API can be used to allocate an IRQ at an index. For
MSIx the driver needs to map the vector table into the memory and add
the corresponding IRQ at the given index. This API will return the
actual IRQ that was used so that the driver can use it create interrupt
handler for that IRQ.

{enable, disable}_interrupt API is used to enable or disable a
particular IRQ at the given index. It is a noop for pin-based
interrupts. This could be used by IRQHandler to enable or disable an
interrupt.
2023-05-07 21:16:41 +02:00
Pankaj Raghav f0b6eb6932 Kernel: Implement helpers to manipulate MSI(x) data structures
MSIx table entry is used to program interrupt vectors and it is
architecture specific. Add helper functions declaration in
Arch/PCIMSI.h. The definition of the function is placed in the
respective arch specific code.
2023-05-07 21:16:41 +02:00
Pankaj Raghav bf7ac06d7b Kernel: Implement {enable,disable}_msix interrupts in PCI Device
Implement enabling and disabling MSIx interrupts for a PCI device.

Removes two TODO()s from PCI::Device.cpp :^)
2023-05-07 21:16:41 +02:00
Pankaj Raghav d3bb63afff Kernel: Use PCIIdentifier is_msix_capable API to retrieve MSIx status
Instead of iterating through the capabilities, use the
is_msix_capable() API from the PCIIdentifier class that belongs to the
device.
2023-05-07 21:16:41 +02:00
Pankaj Raghav d0fbaf790a Kernel: Add MSIxInfo struct to PCI DeviceIdentifier
Add a struct named MSIxInfo that stores all the relevant MSIx
information as a part of PCI DeviceIdentifier struct.

Populate the MSIx struct during the PCI device init. As the
DeviceIdentifier struct need to populate MSIx info, don't mark
DeviceIdentifier as const in the PCI::Device class.
2023-05-07 21:16:41 +02:00
Pankaj Raghav 71c75873c9 Kernel: Add write{8,16,32} to the PCI Capability struct
MSI(x) mechanism requires the device to write to its Capability
structure. Add write{8,16,32} similar to read{8,16,32}.
2023-05-07 21:16:41 +02:00
Pankaj Raghav 91da264a4c Kernel: Add reserve_interrupt_handlers API
MSI(x) interrupts need to reserve IRQs so that it can be programmed by
the device. Add an API to reserve contiguous ranges of interrupt
handlers so that it can used by PCI devices that use MSI(x) mechanism.

This API needs to be implemented by aarch64 architecture.
2023-05-07 21:16:41 +02:00
Pankaj Raghav a5ec5f07fa Kernel/PCI: Set IRQ as reserved for pin-based interrupts
Set pin-based interrupt handler as reserved during PCI bus init.
This is required so that MSI(x) based interrupts can avoid sharing the
IRQ which has been marked as reserved.
2023-05-07 21:16:41 +02:00
Pankaj Raghav e5cc78e9db Kernel: Add m_reserved private variable to GenericInterruptHandler
Pin-based PCI device are allocated an IRQ, and it could be shared with
multiple devices. An interrupt handler with an IRQ for a PCI device
will get registered only during the driver initialization.

For MSI(x) interrupts, the driver has to allocate IRQs and this field
can be used to skip IRQs that have already been reserved by pin-based
interrupts so that we don't have to share IRQs, which generally will
reduce the performance.
2023-05-07 21:16:41 +02:00
MacDue b5e593d0e7 Ladybird: Don't ask Qt to decode any images for us
We should only rely on LibGfx to decode images for us, if LibGfx
can't decode an image that should be motivation to improve LibGfx,
not hidden by Qt picking up the slack :^)
2023-05-07 21:13:02 +02:00
thankyouverycool af8cd477b4 LibGUI: Always paint vertical lines for Frames in unmaximized windows
Fixes incorrect thread highlighting for ResourceGraph panels.

Prior to FrameStyles, these graphs were painted as faux-panels,
this is, sunken containers with a thickness of 1, and weren't
subject to the bug.
2023-05-07 21:12:35 +02:00
Andreas Kling 222a1b8b95 LibWeb: Don't force relayout on scheduled layout update
If something else has already caused a layout, there's no need to force
a new relayout when the layout timer fires.

This avoids a lot of redundant work on many pages. :^)
2023-05-07 21:00:12 +02:00
Kenneth Myhra 50413c2326 Toolchain: Replace inline nproc with get_number_of_processing_units() 2023-05-07 14:29:25 +02:00
Kenneth Myhra 36c892ae14 Meta: Add get_number_of_processing_units() to shell_include.sh
This adds the method get_number_of_processing_units() which returns the
number of processing units the system has available.
2023-05-07 14:29:25 +02:00
Ben Wiederhake 449911c286 Chess: Slightly improve error propagation during startup 2023-05-07 14:04:55 +02:00
Ben Wiederhake 0fe29a48ad Chess: Avoid IODevice and DeprecatedFile 2023-05-07 14:04:55 +02:00
Ben Wiederhake 715f4a8d7e LibSQL: Remove unused IODevice include 2023-05-07 14:04:55 +02:00
Ben Wiederhake 7f70676123 LibJS: Revert to original text in spec
See also:
36ff6187f6
https://github.com/SerenityOS/serenity/pull/18682#issuecomment-1537249544
2023-05-07 11:57:08 +02:00
Fabian Dellwing 589d2d50f5 netstat: Fix fallback value for pid field 2023-05-07 11:55:58 +02:00
Fabian Dellwing 2cd59df443 netstat: Add -e argument
This adds information about the user owning the process to our netstat
output. We do not fully match the behaviour of Linux as we don't show
an inode information.
2023-05-07 11:55:58 +02:00
Fabian Dellwing 34d699b678 netstat: Fix in/out bytes not showing
Some change in our JsonObject API broke the logic here. We now read
the correct type from the JsonObject and convert it to a string ourself.
2023-05-07 11:55:58 +02:00
Fabian Dellwing 2efdac9441 netstat: Fix port numbers not showing
Some change in our JsonObject API broke the logic here. We now read
the correct type from the JsonObject and convert it to a string ourself.
2023-05-07 11:55:58 +02:00
Andreas Kling 4637d020c3 LibWeb: Add fast_is<T>() helper for HTMLScriptElement
This makes loading Google Groups quite a bit faster, as 20% of runtime
while loading was spent asking if DOM nodes are HTMLScriptElement.
2023-05-07 10:47:30 +02:00
Andreas Kling 97f0106edd LibGfx/OpenType: Cache kerning values for faster text layout
The Font class now remembers the results of kerning lookups in a
HashMap. This fixes an issue where text-heavy UI (like WidgetGallery)
would lag when using a UI font with kerning data.
2023-05-07 10:44:05 +02:00
Lucas CHOLLET 677386bfaa LibGfx/JPEG: Use a lookup table to retrieve huffman symbols
Instead of testing all possible code to find the good symbol, we use a
lookup table to directly find the expected symbol. This method is used
by most Huffman decoder (gzip or libjpeg-turbo).

In order to use the correct key when peeking a constant number of bits
from the stream, we generate duplicates in the table. As an example, for
the code 110, all entries with that pattern 110***** will be set to
110's symbol. So, when you read this code plus garbage from following
codes, you still find the correct symbol.
2023-05-07 09:08:56 +02:00
Lucas CHOLLET 9389177e5f LibGfx/JPEG: Make generate_huffman_codes be a method of HuffmanTable
And call it when reading the table definition instead of when starting
to decode the stream.
2023-05-07 09:08:56 +02:00
Lucas CHOLLET 8cba8ed25a LibGfx/JPEG: Rename HuffmanTableSpec => HuffmanTable 2023-05-07 09:08:56 +02:00
Lucas CHOLLET 011fe0d9ba LibGfx/JPEG: Ensure capacity of vector instead of blindly appending 2023-05-07 09:08:56 +02:00
Lucas CHOLLET f4014f898d LibGfx/JPEG: Use peek_bits in next_symbol
This allows us to read all bits in a single shot instead of one by one.
2023-05-07 09:08:56 +02:00
Lucas CHOLLET 5ec2aa4dcc LibGfx/JPEG: Introduce peek_bits and use it in read_bits
While already providing a performance improvement by removing the loop
in `read_bits`, this method was introduced to optimize `next_symbol`.
2023-05-07 09:08:56 +02:00
Lucas CHOLLET 86ce9cc30f LibGfx/JPEG: Encapsulate operations on HuffmanStream
Advantages of encapsulation are really obvious here:
- Put related code together
- Prevent external functions to modify the object
- Abstract the implementation

No functional changes intended.
2023-05-07 09:08:56 +02:00
Lucas CHOLLET 66108d102e LibGfx/JPEG: Store previous DC values in i16
Forgotten child of cfaa5120.
2023-05-07 09:08:56 +02:00
Lucas CHOLLET a08b91e63e LibGfx/JPEG: Rename HuffmanStreamState => HuffmanStream 2023-05-07 09:08:56 +02:00
Andreas Kling af5d892a7e Ladybird: Don't ask Qt to decode SVG images for us
While it's nice to see <img src="foo.svg"> suddenly work in Ladybird
after linking with the Qt SVG module, this is cheating.

We should implement SVG-as-image ourselves instead of relying on 3rd
party code to do it. :^)
2023-05-07 09:06:48 +02:00
Cubic Love eadef3e5c3 Base: Add web server tip to Tips-and-Tricks(7)
Add the very useful tip of how to transfer files from QEMU to your host
machine via the built-in web server.
2023-05-07 07:08:58 +02:00