grfx(7) DG/UX 5.4R3.00 grfx(7)
NAME
grfx - AViiON series workstation graphics processor
DESCRIPTION
This device driver supports the graphics capabilities of the Data
General AViiON series of workstations. The AViiON series graphics
processors are memory mapped devices. Access to the data and command
registers of the graphics processor is provided by mapping these
registers into the user program's logical address space. System
resources used to manage the graphics subsystem are the standard
open(2), close(2), mmap(2), and ioctl(2) system calls.
The open(2) system call provides a handle to access the graphics
processor. The device should be opened for reading and writing.
Multiple opens on the graphics device are allowed, but it is the
application's responsibility to mediate access to the single device.
The close(2) system call frees the handle to the graphics processor
established by open(2).
The mmap(2) system call can be used to map the resources of the
graphics subsystem into the user program's logical address space.
Mmap(2) can then be called with its parameters set as follows:
addr Set to 0 unless the mapping is desired at a specific address.
If a specific address is required, set addr to that (page
aligned) address, and set MAPFIXED in the flags parameter.
len Set to the appropriate size for the resource that is to be
mapped. The size of a given resource is dependent on the
graphics subsystem that is present on a given machine. For
some AViiON models the graphics subsystem is a plug-in module
and therefore the machine can have different resources
depending on which graphics subsystem is installed in the
machine. In order to determine which type of graphics
subsystem is installed you would use the
GRFX_GET_INTERFACE_TYPE function of the ioctl(2) system call
which is described below. Once the interface type is known the
control registers can be mapped in to determine which
variation of a graphics subsystem type is installed in the
machine. The interface types currently supported are defined
by including <sys/ioctl.h> in the user program. Currently the
types that are defined are DevGrfxInterfaceNEC for
monochrome systems, DevGrfxInterfaceCGA and
DevGrfxInterfaceFLAMINGO for color systems. The size of
the control registers is usizeof (necregtype) for
DevGrfxInterfaceNEC, usizeof (cgaregtype) for
DevGrfxInterfaceCGA, and usizeof (flamingoregtype) for
DevGrfxInterfaceFLAMINGO. These structures are defined in
the graphics subsystem header files: <sys/dggrfxmono.h>,
<sys/dggrfxcolor.h> and <sys/dggrfxflamingo.h>. The size
of the frame buffer is 512 kilobytes (0x00080000) for
DevGrfxInterfaceNEC, 1.5 megabytes (0x00180000) for
DevGrfxInterfaceNEC with Kanji memory, 128 megabytes
Licensed material--property of copyright holder(s) 1
grfx(7) DG/UX 5.4R3.00 grfx(7)
(0x08000000) for DevGrfxInterfaceCGA, and 256 megabytes
(0x10000000) for DevGrfxInterfaceFLAMINGO. On graphics
subsystems of type DevGrfxInterfaceFLAMINGO the RAMDAC
resource is accessed separately from the control registers.
To map the RAMDAC and/or AutoLUT memory area the size should
be one logical memory page.
prot Set to (PROTREAD | PROTWRITE).
flags Set to MAPSHARED for the system to select the address for the
mapping, or to (MAPFIXED | MAPSHARED) to map at address
addr.
fd Set to the open file descriptor for the device.
off Set to GRFXREGSMMAPOFFSET to map the control registers,
GRFXFBMMAPOFFSET to map the frame buffer,
GRFXRAMDACMMAPOFFSET for direct RAMDAC access, and
GRFXAUTOLUTMMAPOFFSET to map the AutoLUT memory area. NOTE:
GRFXRAMDACMMAPOFFSET and GRFXAUTOLUTMMAPOFFSET are only
available on graphics subsystems of type
DevGrfxInterfaceFLAMINGO. These constants are defined in
<sys/ioctl.h>.
Upon successful return from mmap(2), the return value indicates the
address at which the graphics resource has been mapped. This address
can be cast to a pointer to the appropriate type, e.g., necregtype,
for subsequent access to the mapped memory.
The ioctl(2) system call has the following form:
int ioctl (fildes, command, argument);
int fildes;
int command;
int argument;
It can be used with the following commands:
GRFXRESET
Resets the video timing on the graphics processor.
GRFXVIDEOENABLE
Enables/disables (argument nonzero/zero) video display.
GRFXLOGERROR
Enables/disables (argument nonzero/zero) graphics error
logging (DevGrfxInterfaceNEC only).
GRFXLOGCLIP
Enables/disables (argument nonzero/zero) logging of clipped
drawing operations (DevGrfxInterfaceNEC only).
GRFXMAPREGS
Maps graphics processor control registers into user memory
Licensed material--property of copyright holder(s) 2
grfx(7) DG/UX 5.4R3.00 grfx(7)
pointed to by argument.
GRFXMAPFB
Maps the frame buffer into user memory pointed to by argument.
GRFXUNMAPREGS
Unmaps graphics processor control registers pointed to by
argument.
GRFXUNMAPFB
Unmaps frame buffer pointed to by argument.
GRFXGETFBSIZES
Returns frame buffer configuration in the grfxfbsizestype
structure pointed to by argument.
GRFXGETINTERFACETYPE
Returns the graphics subsystem interface type in the int
pointed to by argument.
GRFXMAPRAMDAC
Maps RAMDAC control registers into user memory pointed to by
argument. (DevGrfxInterfaceFLAMINGO only)
GRFXMAPAUTOLUT
Maps AutoLUT memory area into user memory pointed to by
argument. (DevGrfxInterfaceFLAMINGO only)
GRFXUNMAPRAMDAC
Unmaps RAMDAC control registers pointed to by argument.
(DevGrfxInterfaceFLAMINGO only)
GRFXUNMAPAUTOLUT
Unmaps AutoLUT memory area pointed to by argument.
(DevGrfxInterfaceFLAMINGO only)
Mapping graphics subsystem resources (excluding the frame buffer)
using ioctl(2) can be accomplished by first reserving one page of
logical memory with valloc(3C). The address returned by valloc(3C)
must then be supplied as the argument to one of the GRFX_MAP* ioctl
commands. Upon return from the ioctl(2) system call, the graphics
resource may be referenced by casting the address supplied in
argument to a pointer to the appropriate resource type. An example
would be to cast the return value to a pointer to a
flamingoregtype.
Graphics frame buffer memory may be mapped using ioctl(2) by first
using valloc(3C) to reserve 512 kilobytes (0x00080000) for
DevGrfxInterfaceNEC, 1.5 megabytes (0x00180000) for
DevGrfxInterfaceNEC with Kanji memory, 128 megabytes (0x08000000)
for DevGrfxInterfaceCGA, or 256 megabytes (0x10000000) for
DevGrfxInterfaceFLAMINGO. The address returned by valloc(3C) must
then be supplied as the argument to the GRFXMAPFB ioctl command.
Upon return from the ioctl(2) system call, the graphics frame buffer
Licensed material--property of copyright holder(s) 3
grfx(7) DG/UX 5.4R3.00 grfx(7)
memory may be referenced beginning at the address supplied in
argument.
FILES
/dev/grfx
grfx device node
/usr/include/sys/ioctl.h
graphics ioctl commands (see
/usr/include/sys/intdggrfxioctl.h)
/usr/include/sys/dggrfxmono.h
DevGrfxInterfaceNEC graphics registers, command and mask
definitions
/usr/include/sys/dggrfxcolor.h
DevGrfxInterfaceCGA graphics registers, command and mask
definitions
/usr/include/sys/dggrfxflamingo.h
DevGrfxInterfaceFLAMINGO graphics registers, command and
mask definitions
SEE ALSO
mmap(2), ioctl(2), valloc(3C).
NOTE
Mapping the video frame buffer via ioctl(2) is not recommended,
because such access may require the system to have an unreasonably
large swap area in order to successfully invoke valloc(3C) as
required. Use mmap(2) to map the frame buffer instead.
NOTE
On DevGrfxInterfaceFLAMINGO type graphics interfaces it is
possible to directly access the RAMDAC color table registers. Since
these accesses would be asynchronous with the vertical blanking
interval, they could cause undesired visual artifacts to appear on
the display. The recommended method for changing color table
information is to use the AutoLUT memory area interface.
Licensed material--property of copyright holder(s) 4