The core DRM lastclose routine automatically destroys all mappings and
releases SG memory. XP10 DRM and DDX assumed this data stayed around
until module unload. xgi_bootstrap was reworked to recreate all these
mappings. In addition, the drm_addmap for the GART backing store was
moved into the kernel. This causes a change to the ioctl protocol and
a version bump.
Based on review comments from airlied, XGI_CHECK_PCI_CONFIG is
removed. He believes (and I tend to agree) that this is a largely
unnecessary workaround for a bug elsewhere.
There were numerous unnecessary fields in xgi_cmd_info. The remaining
fields had pretty crummy names. Cut out the cruft, and rename the
rest. As a result, the unused parameter "triggerCounter" to
triggerHWCommandList can be removed.
Generate the begin command once in a temporary buffer. Then,
depending on whether the command is to be written directly to the
hardware or to a secondary buffer, copy to command to the correct place.
Moved the getCurBatchBeginPort before its only caller. Modified
function to return the command ID instead of the port offset.
Function also now assumes input begin type is value.
Added code to ioctl handler to validate begin type.
xgi_cmdlist_initialize wasn't correctly checking for errors from
xgi_pcie_alloc. Furthermore, xgi_bootstrap, the one caller of
xgi_cmdlist_initialize, wasn't check its return value.
For reasons that I don't understand, the drm_addmap call would succeed
in xgi_driver_load, but writes to the map later would oops. Moving it
to xgi_bootstrap fixes this problem.
The ioctlss XGI_ESC_DEVICE_INFO, XGI_ESC_MEM_COLLECT,
XGI_ESC_PCIE_CHECK, XGI_ESC_GET_SCREEN_INFO, XGI_ESC_PUT_SCREEN_INFO,
XGI_ESC_MMIO_INFO, and XGI_ESC_SAREA_INFO, are completely unnecessary.
The will be doubly useless when the driver is converted to the DRM
infrastructure.
Most occurances of U32 were converted to u32. These are cases where
the data represents something that will be written to the hardware.
Other cases were converted to 'unsigned int'.
U32 was the last type in xgi_types.h, so that file is removed.
These two structures were used as the request and reply for certain
ioctls. Having a different type for an ioctl's input and output is
just wierd. In addition, each structure contained fields (e.g., pid)
that had no business being there.
This change requires updates to user-space.