r270973
Fix for WITNESS warning while doing xpt_rescan.
This happen when converting any JBOD to RAID or creating
any new RAID from Unconfigured Drives.
Without this fix, user may see call trace if WITNESS is enabled.
System may panic when reconfiguring the RAID.
Reviewed by: ambrisko
Approved by: re (gleb)
---
These are largely dumbbell@'s changes. Most significantly they address
the extreme performance degradation with VGA hardware.
SVN revisions in this MFC:
269471 270290 270293 270322 270324 270329 270331 270336 270338 270340
270341 270342 270343 270388 270390 270404 270411 270412 270413 270431
270446 270448 270485 270587 270589 270613 270618 270620 270667 270702
270707 270708 270720 270721 270785 270786
Detailed commit list:
r270290: Test if the cursor is shown only once
Later, we just see if the "struct mouse_cursor" pointer is set. This
avoids the need to mess with all the conditions several times; this
has been error prone.
While here, rename the variable "m" to a more meaningful "cursor",
like it's done elsewhere in the code.
r270293: Rename the "mouse_cursor" structure to "vt_mouse_cursor"
At the same time, "w" and "h" members are now called "width" and
"height". The goal is to have a more "public" structure, because it
will soon be passed as argument to a new callback, replacing
vd_bitbltchr_t.
r269471 (ray):
Fix vt_vga driver to draw not-8-bit-aligned fonts correctly.
Still one bug here: mouse left some gaps on track when moving left.
r270322:
Add new vd_bitblt_text_t callback, and implement it for vt_vga
Compared to the deprecated vd_bitbltchr_t callback, vd_bitblt_text_t
receives:
o the whole text buffer
o the dirty area
o the mouse cursor (map, position, colors)
This allows the backend to perform optimization on how to draw things.
The goal is to remove vd_bitbltchr_t and vd_putchar_t, once all driver
are converted (only vt_vga is included in this commit).
In vt_vga, this allows to draw the text and the cursor in one pass,
without ever reading from video memory (because it has all the context).
The main benefit is the speed improvement: no more slideshow during
boot!
Other bugs fixed in vt_vga are:
o left-most characters are drawn properly (the left-most pixels were
missing with bold characters and some wide letters such as 'm')
o no more black square around the cursor
o no cursor flickering when the text is scrolling
There are still many problems to fix: the known issues are marked with
"FIXME" inside the code.
r270411:
vt_fb: Implement vd_bitblt_text_t for vt_fb and derivatives
r270412:
creator_fb: Implement vd_bitblt_text_t
r270413: ofwfb: Implement vd_bitblt_text_t
r270324: vt_vga: Clip the draw area to never draw offscreen
This fixes a bug when two windows use different fonts, but a longer-
term solution is required. The dirty area should be stored as pixels,
not character cells, because such coordinates don't have the same
meaning in all windows, when using different fonts.
r270329: Mark new mouse position as dirty only when it's actually displayed
r270331: Store cursor bitmap & colors in struct vt_device
This removes the need to specify them to each call to vd_bitblt_text_t
and, therefore, simplifies the API.
r270336: Give the window to vd_bitblt_text_t callback
... instead of both the buffer and the font. Again, this simplifies
the API.
r270338: The offset to center the text area is per-window now
The previous global offset, based on the last loaded font, had no
meaning for other windows. This caused a shifted text area, often
partly out-of-screen.
r270341: vt_vga: Remove a "FIXME" comment; the issue was solved in r270338
r270340: Don't run vt_set_border() and vt_flush() concurrently
In the case of vt_vga, the two concurrent calls were writing to the
same VGA registers, causing incorrect refresh of the screen.
r270342: Use the actual size of the mouse when marking its position as dirty
This fixes a bug where part of the cursor was not erased.
r270343: Remove "FIXME" about multiple locking of vt_buf in vt_flush()
After some testing, it appears that acquiring the lock once and keeping
it longer is slower than taking it multiple times.
While here, fix a typo in another comment.
r270388: vt_vga: Give only the character part of term_char_t to vga_get_cp437()
This fixes a bug where vga_get_cp437() was called with an invalid
argument. The screen was then filled with '?' instead of the actual
character.
r270390: Fix a crash in vt_mark_mouse_position_as_dirty() when in textmode
In textmode, no font is loaded, thus the page fault in
vt_mark_mouse_position_as_dirty() when it wants the font width/height.
For now, create a fake area for the textmode. This needs to be
modified if vt_vga gains mouse support in textmode.
While here, fix a build failure when SC_NO_CUTPASTE is defined:
vt_mark_mouse_position_as_dirty() must not be included in this case.
r270404: Fix cursor handling in vt_flush()
There were situations where the cursor was not erased/redrawn or its
position was marked as dirty even though it's not displayed. The code
is now more straightforward.
At the same, add a function to determine if the cursor covers a given
area. This is used by backends to know if they need to draw the
cursor.
This new function should be paired with a new state in struct
vt_device, called vd_mshown, which indicates if the cursor should be
displayed. This again simplifies vd_bitblt_text_t callback's API.
r270431: vt(4): Add vd_bitblt_bmp_t callback
The code was already there in all backends, we just expose it. This is
used to display the splash screen.
r270446: Remove vd_bitbltchr_t
It's replaced by vd_bitblt_text_t, which gives more context to the
backend and allows it to perform more efficiently when redrawing a
given area.
r270448: Fix order of arguments (x <-> y) when showing the splash screen
r270485: vt_vga: Fix the display of the splash screen
r270587: Take font offset into account in vt_is_cursor_in_area()
This fixes a "General protection fault" in vt_vga, where
vt_is_cursor_in_area() erroneously reported that the cursor was over
the text. This led to negative integers stored in "unsigned int" and
chaos.
r270589: The cursor coordinates are relative to the drawn area
... not the whole screen. Don't use font offsets in
vt_mark_mouse_position_as_dirty().
This fixes a bug where the mouse position wasn't marked as dirty when
approaching the borders of the drawn area.
r270613: Store a rectangle for the drawable area, not just the top-left corner
This allows backends to verify they do not draw outside of this area.
This fixes a bug in vt_vga where the text was happily drawn over the
right and bottom margins, when using the Gallant font.
r270618: Intialize drawable area rectangle each time a font is loaded
This also fixes a problem where early in boot, the area was zero,
leading to nothing displayed for a few seconds.
r270620: vt_vga: Use Write Mode 0 to draw group of 8 pixels using 3 or more colors
This replaces the method based on Write Mode 3, which required reads
from the video memory to load the latches.
r270667: When creating a window buffer, fill it entirely
... not just the visible part.
This fixes a bug where, when switching from eg. vt_vga to vt_fb (ie.
the resolution goes up), the originally hidden, uninitialized area of
the buffer is displayed on the screen. This leads to a missing text
cursor when it's over an unitialized area.
This was also visible when selecting text: the uninitialized area was
not highlighted.
Internally, this area was zeroed: characters were all 0x00000000,
meaning the foreground and background color was black. Now, everything
is filled with a space with a gray foreground color, like the visible
area.
While here, remove the check for the mute flag and always use
TERMINAL_NORM_ATTR as the character attribute (ie. gray foreground,
black background).
r270702: Implement basic support for KDSETMODE ioctl
With the current implementation, this allows an X11 server to tell
the console it switches a particular window in "graphics mode". This
information is used by the mouse handling code to ignore sysmouse events
in the window taken by the X server: only him should receive those
events.
r270707: Pause the vt_flush() timer when the screen is up-to-date
The timer is restarted whenever a window buffer is marked as dirty or
the mouse cursor moves.
There's still room for improvement. For instance, we should not mark a
window buffer as dirty when this window isn't displayed.
r270708: vt(4): Recompute the drawable area when the resolution changes
This was only done when the font changed.
r270720: vt(4): Fix mouse cursor handling in vt_fb/creator_vt/ofwfb
There were two issues:
1. The area given to vt_is_cursor_in_area() was adding the drawable
area offset, something already handled by this function.
2. The cursor was shifted on the screen by the offset of this area
and thus was misplaced or not erased. Furthermore, when reaching
the bottom or right borders, the cursor was either totally
removed or not erased correctly.
r270721: vt(4): If the terminal shrinks, make sure the mouse is inside
the new area
r270785: vt(4): Change vb_history_size from "int" to "unsigned int"
CID: 1230002, 1230003
r270786: Indicate that KDSETRAD case falls through the next case
CID: 1229953
Relnotes: Yes
- Update the OFED Linux Emulation layer as a preparation for a
hardware driver update from Mellanox Technologies.
- Remove empty files from the OFED Linux Emulation layer.
- Fix compile warnings related to printf() and the "%lld" and "%llx"
format specifiers.
- Add some missing 2-clause BSD copyrights.
- Add "Mellanox Technologies, Ltd." to list of copyright holders.
- Add some new compatibility files.
- Fix order of uninit in the mlx4ib module to avoid crash at unload
using the new module_exit_order() function.
Sponsored by: Mellanox Technologies
The goal is to clear the video memory, in case an application drew to
it. So the content shouldn't be loaded in the latches, it can't be
trusted anyway.
This improves a bit the window switch speed.
Sponsored by: The FreeBSD Foundation
The same functionality can be obtained by testing for mask != NULL in
vd_bitbltchr, which all implementations of vd_bitbltchr() were doing
anyway.
Sponsored by: The FreeBSD Foundation
Set fb_pbase properly on PowerPC in the case where we have to guess at
the right register bank for the framebuffer. Disable the assigned-
addresses path on SPARC since it is just a hack for IBM PPC systems
and was neither relevant for nor worked on SPARC anyway.
Sponsored by: The FreeBSD Foundation
r268472 (ray):
Should check fb_read method presence instead of double check for fb_write.
r269620 (nwhitehorn):
Retire various intertwined bits of fbd(4) and vt_fb, in particular the
pixel modification indirection. No actual drivers use it and those
that might (e.g. creatorfb) use custom implementations of
vd_bitbltchr().
Relnotes: No
Sponsored by: The FreeBSD Foundation
Make mmap() of the console device when using ofwfb work like other
supported framebuffer drivers. This lets ofwfb work with
xf86-video-scfb and makes the driver much more generic and less
PCI-centric. This changes some user-visible behavior and will require
updates to the xorg-server port on PowerPC when using ATI graphics
cards.
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
r269601 (nwhitehorn):
Add a simple unaccelerated vt(4) framebuffer driver for Sun
framebuffers handled by creator(4) (Sun Creator 3D, Elite 3D, etc.).
This provides vt(4) consoles on all devices currently supported by
syscons on sparc64. The driver should also be easily adaptable to
support newer Sun framebuffers such as the XVR-500 and higher.
Many thanks to dumbbell@ (Jean-Sebastien Pedron) for testing this
remotely during development.
r269783 (dumbbell):
vt(4): Colors are indexed against a console palette, not a VGA palette
Sponsored by: The FreeBSD Foundation
For reasons which are not clear, r254263 broke some PCMCIA and CardBus
bridges in strange ways, either rendering them unable to detect
insertion and removal events, or possibly unable to read from the
device behind the bridge.
This fixes at least one laptop, a Toshiba Tecra M5 with a Texas
Instruments PCxx12 (d=0x8039 v=0c104c) bridge. The very similar
Tecra M9 has the same bridge, but worked fine without this change.
The bridge chip has no I/O port BAR, and there is nothing in the spec
to suggest I/O decoding should be enabled; however enabling it fixes
the issue. Add an XXX comment to this effect.
Discussed with: jhb, imp
- Nuke unused sdhci_softc.
- Static'ize sdhci_debug local to sdhci.c.
- Const'ify PCI device description strings.
- Nuke redundant resource ID members from sdhci_pci_softc.
- Nuke unused hw.sdhci_pci.debug tunable.
- Add support for using MSI instead of INTx, controllable via the tunable
hw.sdhci.enable_msi (defaulting to on) and tested with a RICOH R5CE823 SD
controller.
- Use NULL instead of 0 for pointers.
This fixes bad looking refresh when switching window: squares instead
of text, flashing screen, and so on. In the worst case, vt_flush() came
at a very inappropriate timing and the screen was not refreshed at all
(leaving squares all over the place).
This doesn't fix the flickering of the screen with vt_vga, because the
sync signal is temporarily stopped and the video memory is cleared.
Sponsored by: The FreeBSD Foundation
r270269:
vt(4): Handle global and per-window mouse cursor toggle in one place
Before the global flag was set/unset using the CONS_MOUSECTL ioctl,
and the per-window flag through the MOUSE_SETLEVEL or MOUSE_SETMODE
ioctls.
Also, if the cursor is already enabled/disabled, return immediatly.
This avoids to reset the cursor's position to the center of the
screen.
This matches syscons' behavior.
While here, remove a trailing space and a redundant variable
declaration.
r270271:
vt(4): Mark cursor old position as dirty before reading the dirty area
Otherwise, the redraw is done during the next vt_flush run.
r270272:
vt(4): If the cursor is globally disabled, don't mark its position as dirty
This avoids unnecessary redraw. In particular, during boot, where the
cursor is disabled and its fake position is [0;0], this triggered a
refresh of the whole screen each time vt_flush() is called.
r270273:
vt(4): If the cursor didn't move, don't mark its position as dirty
Currently, this has no effect, because the cursor is always redrawn
anyway. But this will be useful after improvements to the
vd_bitbltchr_t callback API.
The vt_device structure members used to store the position of the
cursor as of the last redraw are renamed from vd_mdirty{x,y} to
vd_mold{x,y}. The associated comment is fixed too. Also, their value
is now expressed in pixels, not in character columns/row.
r270275:
vt(4): Mark the current cursor position as dirty
Like r270273, this has no effect for now, because the cursor is always
drawn. This is in preparation of future changes to vd_bitbltchr_t API.
r270278:
vt(4): Mark cursor position as dirty when we enable/disable it
Sponsored by: The FreeBSD Foundation
r269188: [Rework vb_buffer and vb_rows assignment]
r269192: Remove special handling of console window size.
It's done in vt_upgrade() for all windows.
r269193: Update comments.
r269194: Revise font initialization handling.
Sponsored by: The FreeBSD Foundation
Allow efifb to be used with xf86-video-scfb. This is important for EFI
systems without either a CSM or real graphics drivers, such as my
Lenovo Haswell laptop.
This provides working X with the small complication of a console
cursor permanently overlaid on the upper-left corner of the screen
that will be dealt with later.
Also remove some redundant screen clearing.
Sponsored by: The FreeBSD Foundation
r268771:
Allow console drivers active from early boot to be used with
xf86-video-scfb, rather than only drivers attached later on. This
involves a small amount of code duplication with dev/fb/fbd.c, which
will fixed later on.
Also improve performance of vt_blank() by making it not read from the
framebuffer unnecessarily.
r268796:
Fix embarassing typos I made.
Sponsored by: The FreeBSD Foundation
On my Lenovo laptop, the firmware maps the EFI framebuffer with MTRRs
set to uncacheable. This leads to execrable console performance. Once
PMAP is up, remap the framebuffer as write-combining. This reduces
boot time on my laptop by 60% when booting with EFI.
Update hptnr(4) driver to version 1.0.1 supplied by the vendor.
v1.0.1 2014-8-19
* Do not retry the command and reset the disk when failed to enable or
disable spin up feature.
* Fix up a bug that disk failed to probe if driver failed to access the
10th LBA.
* Fix a bug that request timeout but it has been completed in certain
cases.
* Support smartmontool for R750.
Many thanks to HighPoint for continued support of FreeBSD!
Add a tunable "hw.mfi.mrsas_enable" to allow mfi(4) to drop priority and
allow mrsas(4) from LSI to attach to newer LSI cards that are support by
mrsas(4). If mrsas(4) is not loaded into the system at boot then mfi(4)
will always attach. If a modified mrsas(4) is loaded in the system. That
modification is return "-30" in it's probe since that is between
BUS_PROBE_DEFAULT and BUS_PROBE_LOW_PRIORITY.
This option is controller by a new probe flag "MFI_FLAGS_MRSAS" in mfi_ident
that denotes cards that should work with mrsas(4). New entries that should
have this option.
This is the first step to get mrsas(4) checked into FreeBSD and to avoid
collision with people that use mrsas(4) from LSI. Since mfi(4) takes
priority, then mrsas(4) users need to rebuild GENERIC. Using the
.disabled="1" method doesn't work since that blocks attaching and the
probe gave it to mfi(4).
MFC r267451 (by delphij):
Correct variable for loader tunable variable hw.mfi.mrsas_enable.
Use the "bSubslotSize" and "bSubFrameSize" fields to obtain the actual
sample size. According to the USB audio frame format specification
from USB.org, the value in the "bBitResolution" field can be less than
the actual sample size, depending on the actual hardware, and should
not be used for this computation.
PR: 192755
- It was decided to change the driver name to if_ixl for FreeBSD
- This release adds the VF Driver to the tree, it can be built into
the kernel or as the if_ixlv module
- The VF driver is independent for the first time, this will be
desireable when full SRIOV capability is added to the OS.
Submitted by: jack.vogel@intel.com and eric.joyner@intel.com
If eapol packets are sent at the lowest rate, key negotiation will
become more reliable.
Submitted by: Akinori Furukoshi <moonlightakkiy at yahoo dot ca>
Rework when the Tx queue completion interrupt is enabled
The Tx interrupt is now kept disabled in the common case, only
enabled when the number of free descriptors in the queue falls
below a threshold. Transmitted frames are cleared from the VQ
before subsequent transmit, or in the watchdog timer.
This was a very big performance improvement for an experimental
Netmap bhyve backend.
r269413, r269428, r269440, r269537, r269644, r269731, and the cxgbe
portion of r270063.
r266571:
cxgbe(4): Remove stray if_up from the code that creates the tracing ifnet.
r266757:
cxgbe(4): netmap support for Terminator 5 (T5) based 10G/40G cards.
Netmap gets its own hardware-assisted virtual interface and won't take
over or disrupt the "normal" interface in any way. You can use both
simultaneously.
For kernels with DEV_NETMAP, cxgbe(4) carves out an ncxl<N> interface
(note the 'n' prefix) in the hardware to accompany each cxl<N>
interface. These two ifnet's per port share the same wire but really
are separate interfaces in the hardware and software. Each gets its own
L2 MAC addresses (unicast and multicast), MTU, checksum caps, etc. You
should run netmap on the 'n' interfaces only, that's what they are for.
With this, pkt-gen is able to transmit > 45Mpps out of a single 40G port
of a T580 card. 2 port tx is at ~56Mpps total (28M + 28M) as of now.
Single port receive is at 33Mpps but this is very much a work in
progress. I expect it to be closer to 40Mpps once done. In any case
the current effort can already saturate multiple 10G ports of a T5 card
at the smallest legal packet size. T4 gear is totally untested.
trantor:~# ./pkt-gen -i ncxl0 -f tx -D 00:07:43🆎cd:ef
881.952141 main [1621] interface is ncxl0
881.952250 extract_ip_range [275] range is 10.0.0.1:0 to 10.0.0.1:0
881.952253 extract_ip_range [275] range is 10.1.0.1:0 to 10.1.0.1:0
881.962540 main [1804] mapped 334980KB at 0x801dff000
Sending on netmap:ncxl0: 4 queues, 1 threads and 1 cpus.
10.0.0.1 -> 10.1.0.1 (00:00:00:00:00:00 -> 00:07:43🆎cd:ef)
881.962562 main [1882] Sending 512 packets every 0.000000000 s
881.962563 main [1884] Wait 2 secs for phy reset
884.088516 main [1886] Ready...
884.088535 nm_open [457] overriding ifname ncxl0 ringid 0x0 flags 0x1
884.088607 sender_body [996] start
884.093246 sender_body [1064] drop copy
885.090435 main_thread [1418] 45206353 pps (45289533 pkts in 1001840 usec)
886.091600 main_thread [1418] 45322792 pps (45375593 pkts in 1001165 usec)
887.092435 main_thread [1418] 45313992 pps (45351784 pkts in 1000834 usec)
888.094434 main_thread [1418] 45315765 pps (45406397 pkts in 1002000 usec)
889.095434 main_thread [1418] 45333218 pps (45378551 pkts in 1001000 usec)
890.097434 main_thread [1418] 45315247 pps (45405877 pkts in 1002000 usec)
891.099434 main_thread [1418] 45326515 pps (45417168 pkts in 1002000 usec)
892.101434 main_thread [1418] 45333039 pps (45423705 pkts in 1002000 usec)
893.103434 main_thread [1418] 45324105 pps (45414708 pkts in 1001999 usec)
894.105434 main_thread [1418] 45318042 pps (45408723 pkts in 1002001 usec)
895.106434 main_thread [1418] 45332430 pps (45377762 pkts in 1001000 usec)
896.107434 main_thread [1418] 45338072 pps (45383410 pkts in 1001000 usec)
...
r268536:
cxgbe(4): Add an iSCSI softc to the adapter structure.
r269076:
Some hooks in cxgbe(4) for the offloaded iSCSI driver.
r269364:
Improve compliance with style.Makefile(5).
r269366:
List one file per line in the Makefiles. This makes it easier to read
diffs when a file is added or removed.
r269411:
cxgbe(4): minor optimizations in ingress queue processing.
Reorganize struct sge_iq. Make the iq entry size a compile time
constant. While here, eliminate RX_FL_ESIZE and use EQ_ESIZE directly.
r269413:
cxgbe(4): Fix an off by one error when looking for the BAR2 doorbell
address of an egress queue.
r269428:
cxgbe(4): some optimizations in freelist handling.
r269440:
cxgbe(4): Remove an unused version of t4_enable_vi.
r269537:
cxgbe(4): Do not run any sleepable code in the SIOCSIFFLAGS handler when
IFF_PROMISC or IFF_ALLMULTI is being flipped. bpf(4) holds its global
mutex around ifpromisc in at least the bpf_dtor path.
r269644:
cxgbe(4): Let caller specify whether it's ok to sleep in
t4_sched_config and t4_sched_params.
r269731:
cxgbe(4): Do not poke T4-only registers on a T5 (and vice versa).
Relnotes: Yes (native netmap support for Chelsio T4/T5 cards)
Remove aicasm as a build dependency. It made sense when the ahc and ahd
drivers and their firmware were under active development, but those days
have passed. The firmware now exists in pre-compiled form, no longer
dependent on it's sources or on aicasm. If you wish to rebuild the
firmware from source, the glue still exists under the 'make firmware'
target in sys/modules/aic7xxx.
This also fixes the problem introduced with r257777 et al with building
kernels the old fashioned way in sys/$arch/compile/$CONFIG when the
ahc/ahd drivers were included.
Changes to how the aicasm tool is built. This series of changes results
in the aicasm tool being built as part of the tools stages of world and
kernel builds.
Most of these changes will ultimately be undone when r260401 is MFC'd,
but it will leave in place the new kernel-build-tool machinery (KTMAKE
stuff) in case a new special kernel tool ever comes along.
Rename vt_generate_vga_palette() to vt_generate_cons_palette() and
change it to build a palette where the color index is the same than in
terminal escape codes, not the VGA index. That's what TCHAR_CREATE()
uses and passes to vt(4).
The main differences between both orders are:
o Blue and red are swapped (1 <-> 4)
o Yellow and cyan are swapped (3 <-> 6)
The problem remained unnoticed, because the RGB bit indexes passed to
vt_generate_vga_palette() were reversed. This inversion was cancelled
by the colors inversions in the generated palette. For instance, red
(0xff0000) and blue (0x0000ff) have bytes in opposite order, but were
swapped in the palette. But after changing the value of blue (see last
paragraph), the modified color was in fact the red one.
While here, tune the palette to better match console colors and improve
the readability (especially the dark blue).
This is an MFC of r269783 and r269791.