Style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37242 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin
2010-06-24 04:29:38 +00:00
parent a56bc48835
commit fd9fa13896
8 changed files with 68 additions and 48 deletions
+2 -2
View File
@@ -21,9 +21,9 @@ static const uint32 fmtColorDepth[] = {
}; };
void 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 (void)et; // avoid compiler warning for unused arg
+2 -1
View File
@@ -59,7 +59,8 @@ TDFX_Init(void)
si.maxFrameBufferSize = si.videoMemSize - si.frameBufferOffset; si.maxFrameBufferSize = si.videoMemSize - si.frameBufferOffset;
TRACE("Video Memory size: %d MB\n", si.videoMemSize / 1024 / 1024); 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) { switch (si.chipType) {
case BANSHEE: case BANSHEE:
@@ -358,7 +358,6 @@ TDFX_SetDisplayMode(const DisplayModeEx& mode)
} }
void void
TDFX_AdjustFrame(const DisplayModeEx& mode) TDFX_AdjustFrame(const DisplayModeEx& mode)
{ {
+5 -3
View File
@@ -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) if (result != B_OK)
return result; return result;
gInfo.sharedInfoArea = clone_area("3DFX shared info", (void**)&(gInfo.sharedInfo), gInfo.sharedInfoArea = clone_area("3DFX shared info",
B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, sharedArea); (void**)&(gInfo.sharedInfo), B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA,
sharedArea);
if (gInfo.sharedInfoArea < 0) if (gInfo.sharedInfoArea < 0)
return gInfo.sharedInfoArea; // sharedInfoArea has error code return gInfo.sharedInfoArea; // sharedInfoArea has error code
+10 -5
View File
@@ -31,7 +31,8 @@ extern "C" void _sPrintf(const char* format, ...);
struct AccelerantInfo { struct AccelerantInfo {
int deviceFileDesc; // file descriptor of kernel driver 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 area_id sharedInfoArea; // shared info area ID
uint8* regs; // base address of MMIO register area uint8* regs; // base address of MMIO register area
@@ -101,9 +102,12 @@ status_t SyncToToken(sync_token* st);
// 2D acceleration // 2D acceleration
void TDFX_FillRectangle(engine_token* et, uint32 color, void TDFX_FillRectangle(engine_token* et, uint32 color,
fill_rect_params* list, uint32 count); fill_rect_params* list, uint32 count);
void TDFX_FillSpan(engine_token* et, uint32 color, uint16* list, uint32 count); void TDFX_FillSpan(engine_token* et, uint32 color, uint16* list,
void TDFX_InvertRectangle(engine_token* et, fill_rect_params* list, uint32 count); uint32 count);
void TDFX_ScreenToScreenBlit(engine_token* et, blit_params* 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 // Video_overlay
uint32 OverlayCount(const display_mode* dm); uint32 OverlayCount(const display_mode* dm);
@@ -146,7 +150,8 @@ bool TDFX_GetEdidInfo(edid1_info& edidInfo);
void TDFX_EngineReset(void); void TDFX_EngineReset(void);
void TDFX_EngineInit(const DisplayModeEx& mode); 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_SetCursorPosition(int x, int y);
void TDFX_AdjustFrame(const DisplayModeEx& mode); void TDFX_AdjustFrame(const DisplayModeEx& mode);
+12 -6
View File
@@ -30,7 +30,8 @@ IsThereEnoughFBMemory(const display_mode* mode, uint32 bitsPerPixel)
uint32 bytesPerPixel = (bitsPerPixel + 7) / 8; 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)) if ( ! IsThereEnoughFBMemory(&mode, mode.bitsPerPixel))
return B_NO_MEMORY; 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.timing.h_display, mode.timing.v_display,
mode.virtual_width, mode.virtual_height, mode.bitsPerPixel); 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 // Copy the list of supported video modes to the location pointed at
// by dmList. // 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; return B_OK;
} }
@@ -276,9 +279,12 @@ GetFrameBufferConfig(frame_buffer_config* pFBC)
{ {
SharedInfo& si = *gInfo.sharedInfo; SharedInfo& si = *gInfo.sharedInfo;
pFBC->frame_buffer = (void*)((addr_t)si.videoMemAddr + si.frameBufferOffset); pFBC->frame_buffer = (void*)((addr_t)si.videoMemAddr
pFBC->frame_buffer_dma = (void*)((addr_t)si.videoMemPCI + si.frameBufferOffset); + si.frameBufferOffset);
pFBC->bytes_per_row = si.displayMode.virtual_width * si.displayMode.bytesPerPixel; 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; return B_OK;
} }
-1
View File
@@ -264,7 +264,6 @@ AllocateOverlay(void)
TRACE("AllocateOverlay() overlay channel already in use\n"); TRACE("AllocateOverlay() overlay channel already in use\n");
return NULL; return NULL;
} }
TRACE("AllocateOverlay() Overlay allocated, overlayToken: %d\n", TRACE("AllocateOverlay() Overlay allocated, overlayToken: %d\n",
si.overlayToken); si.overlayToken);
return (overlay_token)++si.overlayToken; return (overlay_token)++si.overlayToken;
@@ -37,7 +37,7 @@
#define MAX_DEVICES 4 #define MAX_DEVICES 4
#define DEVICE_FORMAT "%04X_%04X_%02X%02X%02X" #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 #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 { struct ChipInfo {
uint16 chipID; // PCI device id of the chip uint16 chipID; // PCI device id of the chip
ChipType chipType; // assigned chip type identifier 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_close(void* dev);
static status_t device_free(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_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 status_t device_ioctl(void* dev, uint32 msg, void* buf, size_t len);
static device_hooks gDeviceHooks = static device_hooks gDeviceHooks =
@@ -105,14 +107,16 @@ static device_hooks gDeviceHooks =
static inline uint32 static inline uint32
GetPCI(pci_info& info, uint8 offset, uint8 size) 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 static inline void
SetPCI(pci_info& info, uint8 offset, uint8 size, uint32 value) 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, B_READ_AREA + B_WRITE_AREA,
(void**)&si.videoMemAddr); (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) { if (si.videoMemArea < 0) {
// Try to map this time without write combining. // Try to map this time without write combining.
@@ -299,7 +304,8 @@ init_hardware(void)
pci_info pciInfo; pci_info pciInfo;
const ChipInfo* pDevice = GetNextSupportedDevice(pciIndex, 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 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. // 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 *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; return status;
} }