Now that we use SYSINIT for the "module" code instead of manually
maintaining lists, we have to make the static library slightly differently.
See inline comment.
Changes to the Haiku module will come in the next commit.
There are a few Haiku-specific changes in here; most notably some
hacks to prevent struct size changes from breaking wpa_supplicant,
and a removal of the full ieee80211_channel structure from some ioctls
where we previously returned it.
FreeBSD 12's net80211 layer contains only 2 small KPI breaks from FreeBSD 11,
so we can upgrade it, apply those 2 changes to the drivers which are affected
(as the changes are in some lesser-used functions), and then upgrade all drivers
one at a time.
* Remove cast to void* in AddItem() at line 775, so that
avoid that the object which was created using 'new' operator
is immediately cast to another type.
Change-Id: I0722661611d0393896c1aac161a702a4c2f1d5d8
Reviewed-on: https://review.haiku-os.org/c/857
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
* Remove cast to void* in AddItem() at line 363, so that
avoid that the object which was created using 'new' operator
is immediately cast to another type.
* Also remove other casts in AddItem().
Change-Id: Ia20ab39ef50dce12b9d06ca5b1736a8a8e3e9cdd
Reviewed-on: https://review.haiku-os.org/c/856
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
The currently included version of libfreetype already has the LCD
subpixel filter turned on by default. With the switch from my
"averaging filter" back to Adrej Spielmann's filtering, there was now
another filtering being done on top of what Freetype already does.
There also seemed to be a problem with the left edge of cached
glyph bitmaps, which I didn't bother to look into. The visual result
of this change is that text looks much crisper, and the display
bugs at touching glyphs is gone.
On the other hand, LCD sub-pixel rendering is still turned on
globally, i.e. for all vector drawing, and for uncached rotated
text. The Freetype filtering is not applied there. This problem did
not exist in my "average filter", since it happened at the scanline
rendering level, not only for cached glyph bitmaps. It is however
not a regression introduced by this commit. It needs to be fixed
separately.
Change-Id: If93c2b85ed479670e6679227984fd8d9f77c11f6
Reviewed-on: https://review.haiku-os.org/c/855
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Also implemented recording DrawString(string, length,
BPoint[] locations), which was previously not recorded at all.
* Also implemented playing back recently added drawing commands
in PicturePlayer.cpp. I don't quite understand what this is
actually used for, but it seemed it was forgotten. I just followed
the pattern already established in the code.
* The other important bit in this change is to update the pen
location when it is needed while recording a BPicture. Often
the BView will use PenLocation() in order to transmit drawing
commands to the app_server which use absolute coordinates only.
This isn't actually so nice, since it means the client has to
wait for the server to transmit the current pen location. If there
were dedicated link-commands for pen-relative drawing commands,
the client could just keep sending without waiting for the server.
In any case, the app_server needs to update the pen location in
the current DrawState and even the DrawingEngine even while
recording a picture, because some next command may need up-2-date
state information, such as the font state and the pen location.
* I have not yet tried to find /all/ instances where the DrawState
needs to be updated while recording. This change should repair
/all/ font state changes, all versions of drawing a string, and
all versions of StrokeLine().
Change-Id: Ia0f23e7b1cd058f70f76a5849acb2d02e0f0da09
Reviewed-on: https://review.haiku-os.org/c/817
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
This time we use the pci_info directly, it avoids a possible race with
PCI config regs, and we already have the value there anyway.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
One crucial fix by me: check if size == 0. This avoids the deadlock
seen in #14795.
Includes some logic fixes to Haiku-specific code in the MII drivers,
and one new chipset supported by the rtl81xx MII driver. Otherwise,
no major functional change.
mmu_man changed this to be dynamically computed based on the BAR size.
It seems his computation was somehow incorrect, as it tries to allocate
a very large region here which deadlocks in the physical memory mapper.
Restoring this to 128KB un-breaks the new ipro1000 driver on more
recent hardware.
"Fixes" #14795.
pause() has granularity of "hz", which on FreeBSD and in our compat layer
is defined to be 1000 (so, 1ms.) As "safe_pause_us" is used copoiously
throughout startup code, this meant that (1) startup takes 100-1000x longer
than it needed to (this driver seems to most commonly delay for 10us),
and (2) this could in theory block the boot for multiple minutes if one
got particularly unlucky with the scheduler.
Probably helps with or even outright fixes#14795.
This should fix the Escape key being non-functional in the EFI loader
menus, which is pretty annoying when one is drilling through lots of
menus to blacklist files...
Previously we just probed and then immediately attached if any devices
were found, after all initialization was done. Now we cannot do that,
as after calling SYSINIT() on certain drivers (e.g. the new ipro1000
driver), certain threads will be created that there is no good way
of tearing down.
Fortunately, it is valid to call probe() on a device before SYSINIT()
(and most other things) have been initialized, and so now we do that
in init_hardware, and then init_driver is called only if we've found
devices we support.
While we're at it, also call pci->reserve_device, which will mark us as
the driver handling said device and prevent other drivers from
using it.
This is the iflib from FreeBSD 12.0 with a few select patches from
FreeBSD trunk applied (and a lot of #ifdef __HAIKU__s, as you can see.)
There are certain things it adds to SYSINIT that can't be un-initialized
(like the grouptaskqueues), and so rather than adding this to every
driver unnecessarily, a separate .a for it makes the most sense.
These are the portions of "freebsd_iflib.a" that I've written and
do not come from FreeBSD. As the import of iflib itself will be
quite large, having a separate commit for these made sense.
Previously, since we passed B_RELATIVE_TIMEOUT unconditionally,
a timeout of 0 would mean that it would return as soon as there was
CPU time available (so, usually, instantly.) This usually was not
a "problem" in that it caused broken behavior, but it would result
in exceptionally high CPU usage.
At first I implemented this correctly (i.e. a timeout of 0 will block
until explicitly woken up) but then discovered that our implementation
of these functions creates subtle race conditions compared to their
FreeBSD counterparts, and so to avoid deadlocks, a timeout of 1 second
is imposed. For situations where there are deadlocks due to race
conditions, this will make them painfully obvious (e.g. all network
transfers stalling for a second every 2-3 seconds or so.)
Previously I implemented "curcpu" as ipro1000 used it, independent
of all the other SMP functions, as an optimization. Now, iflib
wants to use these functions all together, so they have to produce
consistent results.
"const char* name" is alright for the compat layer's needs to
identify functions, as we only scan the method table once and
copy the function pointers to a struct of function pointers.
iflib doesn't use a function pointer struct, though, and expects
to have the KOBJ system for function lookups, and that depends
on integer-based method IDs for fast lookups. So now every
method gets an integer ID as well as a name (and iflib's method
IDs are in the list of method IDs already.)
Adapt other code accordingly. Minimum changes to fix ticket #11478
In theory also font height could be fractional, so we might need to
review other parts of the code.
Change-Id: Idbdbe38193ca5a32b3d09c7cf9accfc917760cae
Reviewed-on: https://review.haiku-os.org/821
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
These methods and fields are missing from the R4 and R5 Be Book, but are
mentionned in the R4 release notes and present in the R5 headers.
Change-Id: I4de8298449bd66e0ee7fe0b52690552916314123
Reviewed-on: https://review.haiku-os.org/820
Reviewed-by: waddlesplash <waddlesplash@gmail.com>