Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37242 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -21,9 +21,9 @@ static const uint32 fmtColorDepth[] = {
|
||||
};
|
||||
|
||||
|
||||
|
||||
void
|
||||
TDFX_FillRectangle(engine_token *et, uint32 color, fill_rect_params *list, uint32 count)
|
||||
TDFX_FillRectangle(engine_token* et, uint32 color, fill_rect_params* list,
|
||||
uint32 count)
|
||||
{
|
||||
(void)et; // avoid compiler warning for unused arg
|
||||
|
||||
|
||||
@@ -59,7 +59,8 @@ TDFX_Init(void)
|
||||
si.maxFrameBufferSize = si.videoMemSize - si.frameBufferOffset;
|
||||
|
||||
TRACE("Video Memory size: %d MB\n", si.videoMemSize / 1024 / 1024);
|
||||
TRACE("frameBufferOffset: 0x%x cursorOffset: 0x%x\n", si.frameBufferOffset, si.cursorOffset);
|
||||
TRACE("frameBufferOffset: 0x%x cursorOffset: 0x%x\n",
|
||||
si.frameBufferOffset, si.cursorOffset);
|
||||
|
||||
switch (si.chipType) {
|
||||
case BANSHEE:
|
||||
|
||||
@@ -358,7 +358,6 @@ TDFX_SetDisplayMode(const DisplayModeEx& mode)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
TDFX_AdjustFrame(const DisplayModeEx& mode)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
|
||||
|
||||
AccelerantInfo gInfo; // global data used by various source files of accelerant.
|
||||
AccelerantInfo gInfo; // global data used by various source files of
|
||||
// accelerant.
|
||||
|
||||
|
||||
|
||||
@@ -33,8 +34,9 @@ InitCommon(int fileDesc)
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
gInfo.sharedInfoArea = clone_area("3DFX shared info", (void**)&(gInfo.sharedInfo),
|
||||
B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, sharedArea);
|
||||
gInfo.sharedInfoArea = clone_area("3DFX shared info",
|
||||
(void**)&(gInfo.sharedInfo), B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA,
|
||||
sharedArea);
|
||||
if (gInfo.sharedInfoArea < 0)
|
||||
return gInfo.sharedInfoArea; // sharedInfoArea has error code
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ extern "C" void _sPrintf(const char* format, ...);
|
||||
struct AccelerantInfo {
|
||||
int deviceFileDesc; // file descriptor of kernel driver
|
||||
|
||||
SharedInfo* sharedInfo; // address of info shared between accelerants & driver
|
||||
SharedInfo* sharedInfo; // address of info shared between
|
||||
// accelerants & driver
|
||||
area_id sharedInfoArea; // shared info area ID
|
||||
|
||||
uint8* regs; // base address of MMIO register area
|
||||
@@ -101,9 +102,12 @@ status_t SyncToToken(sync_token* st);
|
||||
// 2D acceleration
|
||||
void TDFX_FillRectangle(engine_token* et, uint32 color,
|
||||
fill_rect_params* list, uint32 count);
|
||||
void TDFX_FillSpan(engine_token* et, uint32 color, uint16* list, uint32 count);
|
||||
void TDFX_InvertRectangle(engine_token* et, fill_rect_params* list, uint32 count);
|
||||
void TDFX_ScreenToScreenBlit(engine_token* et, blit_params* list, uint32 count);
|
||||
void TDFX_FillSpan(engine_token* et, uint32 color, uint16* list,
|
||||
uint32 count);
|
||||
void TDFX_InvertRectangle(engine_token* et, fill_rect_params* list,
|
||||
uint32 count);
|
||||
void TDFX_ScreenToScreenBlit(engine_token* et, blit_params* list,
|
||||
uint32 count);
|
||||
|
||||
// Video_overlay
|
||||
uint32 OverlayCount(const display_mode* dm);
|
||||
@@ -146,7 +150,8 @@ bool TDFX_GetEdidInfo(edid1_info& edidInfo);
|
||||
void TDFX_EngineReset(void);
|
||||
void TDFX_EngineInit(const DisplayModeEx& mode);
|
||||
|
||||
bool TDFX_LoadCursorImage(int width, int height, uint8* and_mask, uint8* xor_mask);
|
||||
bool TDFX_LoadCursorImage(int width, int height, uint8* and_mask,
|
||||
uint8* xor_mask);
|
||||
void TDFX_SetCursorPosition(int x, int y);
|
||||
|
||||
void TDFX_AdjustFrame(const DisplayModeEx& mode);
|
||||
|
||||
@@ -30,7 +30,8 @@ IsThereEnoughFBMemory(const display_mode* mode, uint32 bitsPerPixel)
|
||||
|
||||
uint32 bytesPerPixel = (bitsPerPixel + 7) / 8;
|
||||
|
||||
return (maxWidth * maxHeight * bytesPerPixel < gInfo.sharedInfo->maxFrameBufferSize);
|
||||
return (maxWidth * maxHeight * bytesPerPixel
|
||||
< gInfo.sharedInfo->maxFrameBufferSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +190,8 @@ SetDisplayMode(display_mode* pMode)
|
||||
if ( ! IsThereEnoughFBMemory(&mode, mode.bitsPerPixel))
|
||||
return B_NO_MEMORY;
|
||||
|
||||
TRACE("Set display mode: %dx%d virtual size: %dx%d color depth: %d bits/pixel\n",
|
||||
TRACE("Set display mode: %dx%d virtual size: %dx%d "
|
||||
"color depth: %d bits/pixel\n",
|
||||
mode.timing.h_display, mode.timing.v_display,
|
||||
mode.virtual_width, mode.virtual_height, mode.bitsPerPixel);
|
||||
|
||||
@@ -258,7 +260,8 @@ GetModeList(display_mode* dmList)
|
||||
// Copy the list of supported video modes to the location pointed at
|
||||
// by dmList.
|
||||
|
||||
memcpy(dmList, gInfo.modeList, gInfo.sharedInfo->modeCount * sizeof(display_mode));
|
||||
memcpy(dmList, gInfo.modeList,
|
||||
gInfo.sharedInfo->modeCount * sizeof(display_mode));
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -276,9 +279,12 @@ GetFrameBufferConfig(frame_buffer_config* pFBC)
|
||||
{
|
||||
SharedInfo& si = *gInfo.sharedInfo;
|
||||
|
||||
pFBC->frame_buffer = (void*)((addr_t)si.videoMemAddr + si.frameBufferOffset);
|
||||
pFBC->frame_buffer_dma = (void*)((addr_t)si.videoMemPCI + si.frameBufferOffset);
|
||||
pFBC->bytes_per_row = si.displayMode.virtual_width * si.displayMode.bytesPerPixel;
|
||||
pFBC->frame_buffer = (void*)((addr_t)si.videoMemAddr
|
||||
+ si.frameBufferOffset);
|
||||
pFBC->frame_buffer_dma = (void*)((addr_t)si.videoMemPCI
|
||||
+ si.frameBufferOffset);
|
||||
pFBC->bytes_per_row = si.displayMode.virtual_width
|
||||
* si.displayMode.bytesPerPixel;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,6 @@ AllocateOverlay(void)
|
||||
TRACE("AllocateOverlay() overlay channel already in use\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TRACE("AllocateOverlay() Overlay allocated, overlayToken: %d\n",
|
||||
si.overlayToken);
|
||||
return (overlay_token)++si.overlayToken;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#define MAX_DEVICES 4
|
||||
#define DEVICE_FORMAT "%04X_%04X_%02X%02X%02X"
|
||||
|
||||
int32 api_version = B_CUR_DRIVER_API_VERSION; // revision of driver API we support
|
||||
int32 api_version = B_CUR_DRIVER_API_VERSION; // revision of driver API used
|
||||
|
||||
#define VENDOR_ID 0x121A // 3DFX vendor ID
|
||||
|
||||
@@ -45,7 +45,8 @@ int32 api_version = B_CUR_DRIVER_API_VERSION; // revision of driver API we suppo
|
||||
struct ChipInfo {
|
||||
uint16 chipID; // PCI device id of the chip
|
||||
ChipType chipType; // assigned chip type identifier
|
||||
const char* chipName; // user recognizable name for chip (must be < 32 chars)
|
||||
const char* chipName; // user recognizable name for chip
|
||||
// (must be < 32 chars)
|
||||
};
|
||||
|
||||
|
||||
@@ -83,7 +84,8 @@ static status_t device_open(const char* name, uint32 flags, void** cookie);
|
||||
static status_t device_close(void* dev);
|
||||
static status_t device_free(void* dev);
|
||||
static status_t device_read(void* dev, off_t pos, void* buf, size_t* len);
|
||||
static status_t device_write(void* dev, off_t pos, const void* buf, size_t* len);
|
||||
static status_t device_write(void* dev, off_t pos, const void* buf,
|
||||
size_t* len);
|
||||
static status_t device_ioctl(void* dev, uint32 msg, void* buf, size_t len);
|
||||
|
||||
static device_hooks gDeviceHooks =
|
||||
@@ -105,14 +107,16 @@ static device_hooks gDeviceHooks =
|
||||
static inline uint32
|
||||
GetPCI(pci_info& info, uint8 offset, uint8 size)
|
||||
{
|
||||
return gPCI->read_pci_config(info.bus, info.device, info.function, offset, size);
|
||||
return gPCI->read_pci_config(info.bus, info.device, info.function, offset,
|
||||
size);
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
SetPCI(pci_info& info, uint8 offset, uint8 size, uint32 value)
|
||||
{
|
||||
gPCI->write_pci_config(info.bus, info.device, info.function, offset, size, value);
|
||||
gPCI->write_pci_config(info.bus, info.device, info.function, offset, size,
|
||||
value);
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +148,8 @@ MapDevice(DeviceInfo& di)
|
||||
B_READ_AREA + B_WRITE_AREA,
|
||||
(void**)&si.videoMemAddr);
|
||||
|
||||
TRACE("Video memory, area: %ld, addr: 0x%lX, size: %ld\n", si.videoMemArea, (uint32)(si.videoMemAddr), videoRamSize);
|
||||
TRACE("Video memory, area: %ld, addr: 0x%lX, size: %ld\n",
|
||||
si.videoMemArea, (uint32)(si.videoMemAddr), videoRamSize);
|
||||
|
||||
if (si.videoMemArea < 0) {
|
||||
// Try to map this time without write combining.
|
||||
@@ -299,7 +304,8 @@ init_hardware(void)
|
||||
pci_info pciInfo;
|
||||
const ChipInfo* pDevice = GetNextSupportedDevice(pciIndex, pciInfo);
|
||||
|
||||
TRACE("init_hardware() - %s\n", pDevice == NULL ? "no supported devices" : "device supported");
|
||||
TRACE("init_hardware() - %s\n",
|
||||
pDevice == NULL ? "no supported devices" : "device supported");
|
||||
|
||||
put_module(B_PCI_MODULE_NAME); // put away the module manager
|
||||
|
||||
@@ -307,7 +313,8 @@ init_hardware(void)
|
||||
}
|
||||
|
||||
|
||||
status_t init_driver(void)
|
||||
status_t
|
||||
init_driver(void)
|
||||
{
|
||||
// Get handle for the pci bus.
|
||||
|
||||
@@ -418,7 +425,8 @@ device_open(const char* name, uint32 /*flags*/, void** cookie)
|
||||
*cookie = &di; // send cookie to opener
|
||||
}
|
||||
|
||||
TRACE("device_open() returning 0x%lx, open count: %ld\n", status, di.openCount);
|
||||
TRACE("device_open() returning 0x%lx, open count: %ld\n", status,
|
||||
di.openCount);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user