Home | History | Annotate | Download | only in sbus
History log of /src/sys/dev/sbus/mgx.c
RevisionDateAuthorComments
 1.24  19-Jul-2023  macallan - make colour depth in fb mode configurable, default to 8bit
- support ioctl(FBIO*CMAP)
 1.23  28-Jun-2023  macallan following a hunch...
- cache DEC and FG registers, only write them if the value actually changes
- wait for the engine to go idle before writing DEC
- wait for FIFO slots on everything else
with this we avoid waiting if possible and still avoid overlapping blit and
fill commands
 1.22  28-Jun-2023  macallan wait for the engine to go idle before issuing rectfill commands
we get occasional overlap with blit commands if we just wait for fifo slots
needs further investigation, it is possible that not all writes to drawing
engine registers are pipelined and of course we don't have docs
 1.21  28-Jun-2023  macallan fix tpyo - now the glyph cache can actually work...
 1.20  11-Nov-2021  macallan branches: 1.20.4;
provide an endian-flipped view of the framebuffer via mmap() if we know how
for now this is sparc64 only
 1.19  31-Oct-2021  macallan remove accidentially committed debug goop
thanks ryo@
 1.18  30-Oct-2021  macallan actually mmap() the blitter registers when asked to, while there do some
magic number reduction
 1.17  22-Oct-2021  macallan return 0 in mgx_ioctl()::FBIOG*
now Xorg can find us
 1.16  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.15  24-Apr-2021  thorpej branches: 1.15.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.14  03-Sep-2018  riastradh branches: 1.14.14;
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.13  28-Mar-2018  macallan branches: 1.13.2;
set WSSCREEN_RESIZE
 1.12  04-Aug-2017  macallan branches: 1.12.2; 1.12.4;
- store bitmap fonts in vram
- don't try to force buffer flushes
- avoid 64bit writes to vram
-> no more corruption of font bitmaps
 1.11  29-Jul-2017  macallan make comment match code...
 1.10  29-Jul-2017  macallan - use hardware to draw bitmap fonts
- while there enable font loading etc.
 1.9  07-May-2016  macallan add Sun /dev/fb* style goop
 1.8  04-Mar-2016  macallan allow mmap()ing blitter registers
 1.7  25-Feb-2016  joerg Mark mgx_wait_host explicitly as unused.
 1.6  11-Feb-2016  macallan support screen blanking and hw cursor
 1.5  11-Feb-2016  macallan switch to 32bit colour in WSDISPLAYIO_MODE_MAPPED, now X with wsfb will work
Not optimal though - for some reason the framebuffer's endianness in 32bit
colour is wrong and I have no idea (yet) how to change that, so many apps
using xrender will crash.
 1.4  06-Jan-2015  macallan branches: 1.4.2;
implement WSDISPLAYIO_*CMAP and WSDISPLAYIO_GET_FBINFO ioctl()s
now X with wsfb works properly
 1.3  06-Jan-2015  macallan - enable alpha fonts now that we have acceleration and glyphcache
- fix drawing of underlined characters
- try to flush framebuffer writes before reading them with the blitter
 1.2  04-Jan-2015  macallan support hardware acceleration, adapted from OpenBSD
TODO: figure out how to do host blits so we can get away without mapping the
framebuffer
 1.1  16-Dec-2014  macallan first draft of a driver for SMSI,mgx
More or less an Alliance Semiconductors ProMotion AT24 with some PCI-SBus
glue and 4MB framebuffer. No acceleration yet, just enough wsdisplay/vcons
setup and DAC programming to be functional.
 1.4.2.5  28-Aug-2017  skrll Sync with HEAD
 1.4.2.4  29-May-2016  skrll Sync with HEAD
 1.4.2.3  19-Mar-2016  skrll Sync with HEAD
 1.4.2.2  06-Apr-2015  skrll Sync with HEAD
 1.4.2.1  06-Jan-2015  skrll file mgx.c was added on branch nick-nhusb on 2015-04-06 15:18:13 +0000
 1.12.4.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.12.4.1  30-Mar-2018  pgoyette Resolve conflicts between branch and HEAD
 1.12.2.2  03-Dec-2017  jdolecek update from HEAD
 1.12.2.1  04-Aug-2017  jdolecek file mgx.c was added on branch tls-maxphys on 2017-12-03 11:37:32 +0000
 1.13.2.1  10-Jun-2019  christos Sync with HEAD
 1.14.14.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.15.8.1  04-Aug-2021  thorpej Adapt to CFARGS().
 1.20.4.1  05-Jul-2023  martin Pull up following revision(s) (requested by abs in ticket #224):

sys/dev/wscons/wsdisplay_vconsvar.h: revision 1.34
sys/dev/wscons/wsdisplay_glyphcachevar.h: revision 1.6
sys/arch/sparc/dev/cgfourteen.c: revision 1.94
sys/arch/sparc/dev/cgfourteen.c: revision 1.95
sys/dev/sbus/mgx.c: revision 1.21
sys/dev/sbus/mgx.c: revision 1.22
sys/dev/sbus/mgx.c: revision 1.23
sys/dev/wscons/wsdisplay_vcons.c: revision 1.65
sys/dev/wscons/wsdisplay_vcons.c: revision 1.66
sys/dev/wscons/wsdisplay_glyphcache.c: revision 1.12
sys/arch/sparc/dev/sxvar.h: revision 1.5
sys/arch/sparc/dev/sx.c: revision 1.6
sys/arch/sparc/dev/sx.c: revision 1.7

make vcons_putchar_buffer() return a flag indicating if anything actually
changed, skip the actual drawing op if nothing did

add flags for drivers to requesr R2L bit/byte-ordered fonts, default to
L2R, chack them in vcons_load_font() instead of just trusting that we'd get
what we need

initialize the diagnostic register with the value suggested by the SunOS
header. This sets a bunch of undocumented bits and yields a 10% speed increase
when rendering antialiased text.

use macros compatible with xf86-video-suncg14 to issue SX instructions
much more readable, alignment weirdness is handled automatically and code is
interchangable

allow drivers to specify horizontal alignment of glyph cache cells
for things like SX which have alignment restrictions

add counter to periodically drain the instruction queue in order to avoid
stalling the MBus during long SX operations

adapted from xf86-video-suncg14
- use sx_wait() to avoid stalling the MBus
- request 32bit alignment for glyphcache cells

wait for the engine to go idle before issuing rectfill commands
we get occasional overlap with blit commands if we just wait for fifo slots
needs further investigation, it is possible that not all writes to drawing
engine registers are pipelined and of course we don't have docs

following a hunch...
- cache DEC and FG registers, only write them if the value actually changes
- wait for the engine to go idle before writing DEC
- wait for FIFO slots on everything else
with this we avoid waiting if possible and still avoid overlapping blit and
fill commands

RSS XML Feed