Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/igsfb.c
RevisionDateAuthorComments
 1.60  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.59  24-Apr-2021  thorpej branches: 1.59.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.58  14-Mar-2018  maya branches: 1.58.18;
Don't left shift a negative, use unsigned for bit masks.
Appeases GCC 6 in some build configuration (ALL kernel)

ok uwe
 1.57  24-Jan-2018  riastradh branches: 1.57.2;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.56  25-Jan-2017  jakllsch Improve/fix igsfb(4) support for 15BPP.

Use howmany(depth, NBBY) instead of (depth >> 3), so that 15 bits maps
to 2 bytes instead of 1.

While here, in a nearly-identical change, don't hard-code 8BPP into the
CyberPro blitter.
 1.55  25-Jan-2017  jakllsch Map coprocessor registers before igsfb_hw_setup(), they are needed for
setting up the video mode.
 1.54  25-Jan-2017  jakllsch igsfb(4): use WSDISPLAY_BORDER_COLOR for overscan color
 1.53  14-Jul-2016  msaitoh branches: 1.53.2; 1.53.4;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF
 1.52  11-Jan-2012  macallan branches: 1.52.6; 1.52.24;
wsfont_matches() and wsfont_find() take an extra parameter now
 1.51  11-Jan-2012  macallan use rasops_init(0, 0)
 1.50  26-Jul-2011  mrg branches: 1.50.2; 1.50.6;
convert to device_t, cfdata_t and CFATTACH_DECL_NEW.
 1.49  12-May-2010  macallan set RI_NO_AUTO then attaching early, clear it otherwise
 1.48  24-Dec-2009  elad branches: 1.48.2; 1.48.4;
Change a comment. INSECURE has but one purpose.
 1.47  18-Nov-2009  macallan Make colour depths higher than 8bit work in X.
Now igsfb will switch to 16 or 32 bit colour when entering graphics mode,
depending on available video memory and the given mode.
While there re-initialize the colour map etc. when leaving graphics mode.
 1.46  11-Nov-2009  macallan add modeseting support. Now if there's a mode string in igsfb_devconfig the
driver will try to use it if at all possible, otherwise fall back to the old
hardcoded 1024x768x60 mode.
 1.45  10-Nov-2009  macallan add support for an optional machine-dependent mmap() method, so the bus
backend can do whatever voodoo necessary to the aperture, IO space etc.
Mainly for shark, to get around the weird ARM bus_space.
 1.44  08-Apr-2008  cegger branches: 1.44.4;
use aprint_*_dev and device_xname
 1.43  19-Oct-2007  ad branches: 1.43.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.42  04-Mar-2007  christos branches: 1.42.2; 1.42.14; 1.42.16; 1.42.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.41  13-Jan-2007  cube branches: 1.41.2;
The definition of bus_space_vaddr on i386 makes it inappropriate as the
first argument to memset(), so change the code very slightly to workaround
that.
 1.40  18-Aug-2006  uwe branches: 1.40.2;
G/c unnecessary includes.
 1.39  20-May-2006  mrg initialise pos.x and pos.y to appease GCC4.
 1.38  12-Apr-2006  jmmv branches: 1.38.2;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.37  05-Apr-2006  uwe KNF: no parentheses around return value.
 1.36  05-Apr-2006  uwe ANSI'ify.
 1.35  04-Apr-2006  uwe Add dc_stride member to igsfb_devconfig.

Eliminate all mentions of rasops_info from igsfb_ioctl(), we have all
the information in igsfb_devconfig now. It's semantically correct to
serve that info from there, not from a cached copy in rasops_info.
 1.34  04-Apr-2006  uwe Use bus_space_vaddr() to get the address of the framebuffer.
 1.33  04-Apr-2006  uwe Use designated initializers for wsscreen structs. It takes less space
and is easier to read. While here, update function name in comment.
 1.32  04-Apr-2006  uwe Nuke delay() that sneaked in with one of old revisions. It's not
necessary.

When we attach as console on netwinder, the timer is not yet attached,
so delay() resorts to a busy loop. That loop takes BIGNUM seconds(!)
to complete. That makes you think the machine wedged.
 1.31  03-Apr-2006  uwe Fix indentation nits.
 1.30  03-Apr-2006  uwe Honor RI_FULLCLEAR in igsfb_accel_eraserows.
 1.29  03-Apr-2006  uwe Properly fix cursor sprite endianness problems: always build
cc_sprite[] in little-endian, as that's how the card wants it.

Tested on netwinder (hardware bswap) by myself, and on current krups
kernel (no bswap) and 3.0 krups kernel (software bswap) by macallan.
 1.28  24-Feb-2006  macallan branches: 1.28.2; 1.28.4; 1.28.6;
clear the whole screen on startup, fix an endianness mismatch when creating
the cursor sprite - this needs to be tested ( and probably fixed ) on a
netwinder.
 1.27  23-Feb-2006  macallan Add support for virtual consoles to igsfb.
Works fine on a Krups, needs testing on other ports.
 1.26  11-Dec-2005  christos branches: 1.26.2; 1.26.4; 1.26.6;
merge ktrace-lwp.
 1.25  01-Oct-2005  macallan revert unnecessary geometry changes, add missing {} so turning off the
cursor when leaving emulation mode and getting it back when re-entering really
works now.
 1.24  30-Sep-2005  uwe Minor KNF police.
 1.23  30-Sep-2005  macallan - turn off the hardware cursor when leaving WSDISPLAYIO_MODE_EMUL
- only lock the hardware cursor when not in WSDISPLAYIO_MODE_EMUL
- allow cursor position between 0 and (screen width + max. cursor width - 1),
same for height so it can move partially offscreen in all directions
 1.22  12-Sep-2005  macallan add a blank line before case WSDISPLAYIO_LINEBYTES
 1.21  12-Sep-2005  macallan add ioctl(WSDISPLAYIO_LINEBYTES) - needed by XFree's wsfb
 1.20  27-Feb-2005  perry branches: 1.20.4;
nuke trailing whitespace
 1.19  26-Nov-2004  uwe branches: 1.19.4; 1.19.6;
Use standard uintN_t types instead of home-grown u_intN_t types.
 1.18  26-Nov-2004  uwe Fix several typos in comments.
 1.17  13-Nov-2003  chs eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.16  07-Nov-2003  uwe Supress bogus -Wuninitialized warnings.
 1.15  31-Aug-2003  uwe Comment change only, the ioctl is WSDISPLAYIO_PUTCMAP, not ..._SETCMAP.
The function is called igsfb_set_cmap() to follow the get/set/update
naming convention.
 1.14  24-Jun-2003  uwe branches: 1.14.2;
Only install accelerated rasops for CyberPro, we don't know yet how to
access the coprocessor on 1682 in Krups.
 1.13  10-Jun-2003  uwe Correct calculation of the blit src/dst for blits we do backwards.
 1.12  31-May-2003  uwe Implement accelerated text ops using graphic coprocessor.
 1.11  11-May-2003  uwe Use hardware sprite for the text mode cursor.
Fail cursor related ioctls with EBUSY while in text mode.

Don't do uvm_useracc checks before copyout, instead check copyout()
return value directly.

Minor cleanups.
 1.10  10-May-2003  uwe Don't need a separate bit expansion table for the cursor mask.
 1.9  10-May-2003  uwe Enforce that the cursor position and the hot spot are within bounds.
Constify a bit. Fix unsignedness of a few local variables.
 1.8  10-May-2003  uwe Redo attachment to support proper cnattach.
wscons on netwinder almost works now.
 1.7  12-Jan-2003  uwe Quick patch to allow the (only) screen to be configured with
wsconscfg(8) when it's not being used as the console.
 1.6  24-Sep-2002  uwe Add some preliminary support for setting up the CyberPro in Netwinder.
Setup sequence obtained from Krups OFW with some CyberPro-specific
magic from Linux driver. The driver still has a lot of hardcoded
stuff, but it is useful enough to bring up wscons on netwinder.

XXX: Proper console attachment needs to be written (the driver was
originally developed on sparc, where our approach to attaching console
is totally different).

Caveat emptor!
 1.5  03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.4  21-Jul-2002  uwe Add definitions of IGS coprocessor registers (not used yet).
Always init chip via I/O space.
Map only I/O registers we actually need.
Automatically detect if we need to do bswapping
Add (untested) code to use automagic bswap on CyberPro.
Report video memory amount.
Report if/how bswapping is done.
 1.3  04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.2  05-Apr-2002  uwe branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Clean up includes.
 1.1  30-Mar-2002  uwe First cut at framebuffer driver for Integraphics Systems IGA1682.
It's not finished yet, but it can do enough to get wscons working for
Krups JavaStation.
 1.2.8.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.8.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.8.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1  05-Apr-2002  jdolecek file igsfb.c was added on branch kqueue on 2002-06-23 17:46:29 +0000
 1.2.6.1  07-Aug-2002  lukem Pull up revision 1.5 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.2.4.2  29-Aug-2002  gehenna catch up with -current.
 1.2.4.1  15-Jul-2002  gehenna catch up with -current.
 1.2.2.6  15-Jan-2003  thorpej Sync with HEAD.
 1.2.2.5  18-Oct-2002  nathanw Catch up to -current.
 1.2.2.4  13-Aug-2002  nathanw Catch up to -current.
 1.2.2.3  01-Aug-2002  nathanw Catch up to -current.
 1.2.2.2  17-Apr-2002  nathanw Catch up to -current.
 1.2.2.1  05-Apr-2002  nathanw file igsfb.c was added on branch nathanw_sa on 2002-04-17 00:05:38 +0000
 1.14.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.5  27-Jan-2005  skrll Adapt to branch.
 1.14.2.4  29-Nov-2004  skrll Sync with HEAD.
 1.14.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1  03-Aug-2004  skrll Sync with HEAD
 1.19.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.4.1  29-Apr-2005  kent sync with -current
 1.20.4.5  27-Oct-2007  yamt sync with head.
 1.20.4.4  03-Sep-2007  yamt sync with head.
 1.20.4.3  26-Feb-2007  yamt sync with head.
 1.20.4.2  30-Dec-2006  yamt sync with head.
 1.20.4.1  21-Jun-2006  yamt sync with head.
 1.26.6.2  01-Jun-2006  kardel Sync with head.
 1.26.6.1  22-Apr-2006  simonb Sync with head.
 1.26.4.1  09-Sep-2006  rpaulo sync with head
 1.26.2.1  01-Mar-2006  yamt sync with head.
 1.28.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.28.4.1  19-Apr-2006  elad sync with head.
 1.28.2.3  03-Sep-2006  yamt sync with head.
 1.28.2.2  24-May-2006  yamt sync with head.
 1.28.2.1  11-Apr-2006  yamt sync with head
 1.38.2.1  19-Jun-2006  chap Sync with head.
 1.40.2.1  01-Feb-2007  ad Sync with head.
 1.41.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.42.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.42.16.1  06-Nov-2007  matt sync with HEAD
 1.42.14.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.42.2.1  23-Oct-2007  ad Sync with head.
 1.43.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.44.4.2  11-Aug-2010  yamt sync with head.
 1.44.4.1  11-Mar-2010  yamt sync with head
 1.48.4.1  30-May-2010  rmind sync with head
 1.48.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.50.6.1  18-Feb-2012  mrg merge to -current.
 1.50.2.1  17-Apr-2012  yamt sync with head
 1.52.24.2  05-Feb-2017  skrll Sync with HEAD
 1.52.24.1  05-Oct-2016  skrll Sync with HEAD
 1.52.6.1  03-Dec-2017  jdolecek update from HEAD
 1.53.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.53.2.1  20-Mar-2017  pgoyette Sync with HEAD
 1.57.2.1  15-Mar-2018  pgoyette Synch with HEAD
 1.58.18.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.59.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed