Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37242 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a56bc48835
commit
fd9fa13896
@ -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
|
||||
|
||||
@ -52,7 +52,7 @@ TDFX_FillRectangle(engine_token *et, uint32 color, fill_rect_params *list, uint3
|
||||
|
||||
|
||||
void
|
||||
TDFX_FillSpan(engine_token *et, uint32 color, uint16 *list, uint32 count)
|
||||
TDFX_FillSpan(engine_token* et, uint32 color, uint16* list, uint32 count)
|
||||
{
|
||||
(void)et; // avoid compiler warning for unused arg
|
||||
|
||||
@ -81,7 +81,7 @@ TDFX_FillSpan(engine_token *et, uint32 color, uint16 *list, uint32 count)
|
||||
|
||||
|
||||
void
|
||||
TDFX_InvertRectangle(engine_token *et, fill_rect_params *list, uint32 count)
|
||||
TDFX_InvertRectangle(engine_token* et, fill_rect_params* list, uint32 count)
|
||||
{
|
||||
(void)et; // avoid compiler warning for unused arg
|
||||
|
||||
@ -108,7 +108,7 @@ TDFX_InvertRectangle(engine_token *et, fill_rect_params *list, uint32 count)
|
||||
|
||||
|
||||
void
|
||||
TDFX_ScreenToScreenBlit(engine_token *et, blit_params *list, uint32 count)
|
||||
TDFX_ScreenToScreenBlit(engine_token* et, blit_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
|
||||
@ -68,14 +69,14 @@ status_t GetAccelerantDeviceInfo(accelerant_device_info* adi);
|
||||
uint32 AccelerantModeCount(void);
|
||||
status_t GetModeList(display_mode* dm);
|
||||
status_t ProposeDisplayMode(display_mode* target, const display_mode* low,
|
||||
const display_mode* high);
|
||||
const display_mode* high);
|
||||
status_t SetDisplayMode(display_mode* mode_to_set);
|
||||
status_t GetDisplayMode(display_mode* current_mode);
|
||||
status_t GetFrameBufferConfig(frame_buffer_config* a_frame_buffer);
|
||||
status_t GetPixelClockLimits(display_mode* dm, uint32* low, uint32* high);
|
||||
status_t MoveDisplay(uint16 h_display_start, uint16 v_display_start);
|
||||
void TDFX_SetIndexedColors(uint count, uint8 first, uint8* color_data,
|
||||
uint32 flags);
|
||||
uint32 flags);
|
||||
status_t GetEdidInfo(void* info, size_t size, uint32* _version);
|
||||
|
||||
// DPMS
|
||||
@ -85,14 +86,14 @@ status_t TDFX_SetDPMSMode(uint32 dpms_flags);
|
||||
|
||||
// Cursor
|
||||
status_t SetCursorShape(uint16 width, uint16 height, uint16 hot_x, uint16 hot_y,
|
||||
uint8* andMask, uint8* xorMask);
|
||||
uint8* andMask, uint8* xorMask);
|
||||
void MoveCursor(uint16 x, uint16 y);
|
||||
void TDFX_ShowCursor(bool bShow);
|
||||
|
||||
// Engine Management
|
||||
uint32 AccelerantEngineCount(void);
|
||||
status_t AcquireEngine(uint32 capabilities, uint32 max_wait, sync_token* st,
|
||||
engine_token** et);
|
||||
engine_token** et);
|
||||
status_t ReleaseEngine(engine_token* et, sync_token* st);
|
||||
void WaitEngineIdle(void);
|
||||
status_t GetSyncToken(engine_token* et, sync_token* st);
|
||||
@ -100,24 +101,27 @@ 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);
|
||||
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);
|
||||
|
||||
// Video_overlay
|
||||
uint32 OverlayCount(const display_mode *dm);
|
||||
uint32 OverlayCount(const display_mode* dm);
|
||||
const uint32* OverlaySupportedSpaces(const display_mode *dm);
|
||||
uint32 OverlaySupportedFeatures(uint32 a_color_space);
|
||||
const overlay_buffer* AllocateOverlayBuffer(color_space cs, uint16 width,
|
||||
uint16 height);
|
||||
status_t ReleaseOverlayBuffer(const overlay_buffer *ob);
|
||||
status_t GetOverlayConstraints(const display_mode *dm,
|
||||
const overlay_buffer *ob, overlay_constraints *oc);
|
||||
uint16 height);
|
||||
status_t ReleaseOverlayBuffer(const overlay_buffer* ob);
|
||||
status_t GetOverlayConstraints(const display_mode* dm,
|
||||
const overlay_buffer* ob, overlay_constraints* oc);
|
||||
overlay_token AllocateOverlay(void);
|
||||
status_t ReleaseOverlay(overlay_token ot);
|
||||
status_t ConfigureOverlay(overlay_token ot, const overlay_buffer *ob,
|
||||
const overlay_window *ow, const overlay_view *ov);
|
||||
status_t ConfigureOverlay(overlay_token ot, const overlay_buffer* ob,
|
||||
const overlay_window* ow, const overlay_view* ov);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
@ -136,7 +140,7 @@ bool IsModeUsable(const display_mode* mode);
|
||||
// 3dfx functions.
|
||||
|
||||
bool TDFX_DisplayOverlay(const overlay_window* window,
|
||||
const overlay_buffer* buffer, const overlay_view* view);
|
||||
const overlay_buffer* buffer, const overlay_view* view);
|
||||
void TDFX_StopOverlay(void);
|
||||
|
||||
status_t TDFX_Init(void);
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -128,8 +129,8 @@ CreateModeList(bool (*checkMode)(const display_mode* mode))
|
||||
|
||||
|
||||
status_t
|
||||
ProposeDisplayMode(display_mode *target, const display_mode *low,
|
||||
const display_mode *high)
|
||||
ProposeDisplayMode(display_mode* target, const display_mode* low,
|
||||
const display_mode* high)
|
||||
{
|
||||
(void)low; // avoid compiler warning for unused arg
|
||||
(void)high; // avoid compiler warning for unused arg
|
||||
@ -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;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ ReleaseOverlayBuffer(const overlay_buffer* buffer)
|
||||
|
||||
status_t
|
||||
GetOverlayConstraints(const display_mode* mode, const overlay_buffer* buffer,
|
||||
overlay_constraints *constraints)
|
||||
overlay_constraints* constraints)
|
||||
{
|
||||
if ((mode == NULL) || (buffer == NULL) || (constraints == NULL))
|
||||
return B_ERROR;
|
||||
@ -260,11 +260,10 @@ AllocateOverlay(void)
|
||||
// There is only a single overlay channel; thus, check if it is already
|
||||
// allocated.
|
||||
|
||||
if( atomic_or(&si.overlayAllocated, 1) != 0) {
|
||||
if (atomic_or(&si.overlayAllocated, 1) != 0) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user