本文整理匯總了C++中D_BUG函數的典型用法代碼示例。如果您正苦於以下問題:C++ D_BUG函數的具體用法?C++ D_BUG怎麽用?C++ D_BUG使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了D_BUG函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: D_DEBUG_AT
void
VoodooDispatcher::ProcessMessages( VoodooMessageHeader *first,
size_t total_length )
{
D_DEBUG_AT( Voodoo_Dispatcher, "VoodooDispatcher::%s( %p, first %p, total_length "_ZU" )\n",
__func__, this, first, total_length );
D_MAGIC_ASSERT( this, VoodooDispatcher );
VoodooMessageHeader *header = first;
size_t offset = 0;
size_t aligned;
while (offset < total_length) {
/* Get the message header. */
header = (VoodooMessageHeader *)((char*) first + offset);
aligned = VOODOO_MSG_ALIGN( header->size );
D_DEBUG_AT( Voodoo_Dispatcher, " -> Next message has %d ("_ZU") bytes and is of type %d... (offset "_ZU"/"_ZU")\n",
header->size, aligned, header->type, offset, total_length );
D_ASSERT( header->size >= (int) sizeof(VoodooMessageHeader) );
D_ASSERT( header->size <= MAX_MSG_SIZE );
D_ASSERT( offset + aligned <= total_length );
switch (header->type) {
case VMSG_SUPER:
manager->handle_super( (VoodooSuperMessage*) header );
break;
case VMSG_REQUEST:
manager->handle_request( (VoodooRequestMessage*) header );
break;
case VMSG_RESPONSE:
manager->handle_response( (VoodooResponseMessage*) header );
break;
case VMSG_DISCOVER:
manager->handle_discover( header );
break;
case VMSG_SENDINFO: // should only be received by TCP fake player, not manager
D_BUG( "received SENDINFO" );
break;
default:
D_BUG( "invalid message type %d", header->type );
break;
}
offset += aligned;
}
D_ASSERT( offset == total_length );
}
示例2: sdlSetState
static void sdlSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs,
CardState *state, DFBAccelerationMask accel )
{
SDLDeviceData *sdev = (SDLDeviceData*) dev;
sdev->dest = state->dst.handle;
sdev->source = state->src.handle;
if (state->mod_hw & (SMF_SOURCE | SMF_BLITTING_FLAGS | SMF_SRC_COLORKEY))
sdev->key_valid = false;
if (state->mod_hw & (SMF_DESTINATION | SMF_COLOR))
sdev->color_valid = false;
switch (accel) {
case DFXL_FILLRECTANGLE:
if (!sdev->color_valid) {
switch (state->destination->config.format) {
case DSPF_RGB16:
case DSPF_RGB32:
sdev->color = dfb_color_to_pixel( state->destination->config.format,
state->color.r,
state->color.g,
state->color.b );
break;
default:
D_BUG( "unexpected format" );
}
sdev->color_valid = true;
}
state->set |= SDL_DRAWING_FUNCTIONS;
break;
case DFXL_BLIT:
if (!sdev->key_valid) {
SDL_SetColorKey( sdev->source,
(state->blittingflags &
DSBLIT_SRC_COLORKEY) ? SDL_SRCCOLORKEY : 0,
state->src_colorkey | 0xff000000 );
sdev->key_valid = true;
}
state->set |= SDL_BLITTING_FUNCTIONS;
break;
default:
D_BUG("unexpected acceleration" );
break;
}
state->mod_hw = 0;
}
示例3: driver_open_device
/*
* Open the device, fill out information about it,
* allocate and fill private data, start input thread.
* Called during initialization, resuming or taking over mastership.
*/
static DFBResult
driver_open_device( CoreInputDevice *device,
unsigned int number,
InputDeviceInfo *info,
void **driver_data )
{
InputHubDeviceNode *node;
D_DEBUG_AT( Input_Hub, "%s( ID %u )\n", __FUNCTION__, number );
node = direct_hash_lookup( m_nodes, number );
if (!node) {
D_BUG( "did not find device (ID %u)", number );
return DFB_BUG;
}
info->prefered_id = number;
info->desc = node->description;
node->device = device;
*driver_data = (void*)(long) (number + 1);
return DFB_OK;
}
示例4: vmware_validate_COLOR
/*
* Called by vmwareSetState() to ensure that the color register is properly set
* for execution of rendering functions.
*/
static inline void
vmware_validate_COLOR( VMWareDeviceData *vdev,
CardState *state )
{
switch (vdev->dst_format) {
case DSPF_ARGB:
vdev->color_pixel = PIXEL_ARGB( state->color.a,
state->color.r,
state->color.g,
state->color.b );
break;
case DSPF_RGB32:
vdev->color_pixel = PIXEL_RGB32( state->color.r,
state->color.g,
state->color.b );
break;
case DSPF_RGB16:
vdev->color_pixel = PIXEL_RGB16( state->color.r,
state->color.g,
state->color.b );
break;
default:
D_BUG( "unexpected format %s", dfb_pixelformat_name(vdev->dst_format) );
}
/* Set the flag. */
VMWARE_VALIDATE( COLOR );
}
示例5: i810_set_color
static inline void
i810_set_color(I810DriverData *i810drv,
I810DeviceData *i810dev,
CardState *state)
{
if (i810dev->i_color)
return;
switch (state->destination->config.format) {
case DSPF_LUT8:
i810dev->color_value = state->color_index;
break;
case DSPF_ARGB1555:
i810dev->color_value = PIXEL_ARGB1555(state->color.a,
state->color.r,
state->color.g,
state->color.b);
break;
case DSPF_RGB16:
i810dev->color_value = PIXEL_RGB16(state->color.r,
state->color.g,
state->color.b);
break;
case DSPF_RGB24:
i810dev->color_value = PIXEL_RGB32(state->color.r,
state->color.g,
state->color.b);
break;
default:
D_BUG("unexpected pixelformat~");
}
i810dev->i_color = 1;
}
示例6: i810_set_dest
static inline void
i810_set_dest(I810DriverData *i810drv,
I810DeviceData *i810dev,
CardState *state)
{
CoreSurface *destination = state->destination;
if (i810dev->i_dst)
return;
i810dev->destaddr = dfb_gfxcard_memory_physical((CoreGraphicsDevice *) i810dev,
state->dst.offset);
i810dev->destpitch = state->dst.pitch;
switch (destination->config.format) {
case DSPF_LUT8:
i810dev->pixeldepth = 1;
i810dev->blit_color = BPP8;
break;
case DSPF_ARGB1555:
i810dev->pixeldepth = 2;
i810dev->blit_color = BPP16;
break;
case DSPF_RGB16:
i810dev->pixeldepth = 2;
i810dev->blit_color = BPP16;
break;
case DSPF_RGB24:
i810dev->pixeldepth = 3;
i810dev->blit_color = BPP24;
break;
default:
D_BUG("unexpected pixelformat~");
}
i810dev->i_dst = 1;
}
示例7: pvr2d_validate_SOURCE
/*
* Called by pvr2dSetState() to ensure that the source parameters are properly
* set for execution of blitting functions. gdev->prog_index must be valid.
*/
static inline void
pvr2d_validate_SOURCE(PVR2DDriverData *gdrv,
PVR2DDeviceData *gdev,
CardState *state)
{
D_DEBUG_AT(PVR2D__2D, "%s( format 0x%08x )\n", __FUNCTION__, state->source->config.format);
gdrv->bltinfo.pSrcMemInfo = state->src.handle;
gdrv->bltinfo.SrcOffset = 0;
gdrv->bltinfo.SrcStride = state->src.pitch;
gdrv->bltinfo.SrcSurfWidth = state->source->config.size.w;
gdrv->bltinfo.SrcSurfHeight = state->source->config.size.h;
switch (state->source->config.format) {
case DSPF_A8:
gdrv->bltinfo.SrcFormat = PVR2D_ALPHA8;
break;
case DSPF_ARGB:
case DSPF_RGB32:
gdrv->bltinfo.SrcFormat = PVR2D_ARGB8888;
break;
case DSPF_RGB16:
gdrv->bltinfo.SrcFormat = PVR2D_RGB565;
break;
default:
D_BUG( "unexpected pixelformat %d", state->source->config.format );
}
// Set the flag.
PVR2D_VALIDATE(SOURCE);
}
示例8: dfb_state_set_rop_pattern
void
dfb_state_set_rop_pattern( CardState *state,
const u32 *pattern,
DFBSurfacePatternMode pattern_mode )
{
D_MAGIC_ASSERT( state, CardState );
D_ASSERT( pattern != NULL );
switch (pattern_mode) {
case DSPM_8_8_MONO:
if (state->rop_pattern_mode != pattern_mode || memcmp( state->rop_pattern, pattern, sizeof(u32) * 8*8/32 )) {
direct_memcpy( state->rop_pattern, pattern, sizeof(u32) * 8*8/32 );
state->rop_pattern_mode = pattern_mode;
state->modified |= SMF_ROP_PATTERN;
}
break;
case DSPM_32_32_MONO:
if (state->rop_pattern_mode != pattern_mode || memcmp( state->rop_pattern, pattern, sizeof(u32) * 32*32/32 )) {
direct_memcpy( state->rop_pattern, pattern, sizeof(u32) * 32*32/32 );
state->rop_pattern_mode = pattern_mode;
state->modified |= SMF_ROP_PATTERN;
}
break;
default:
D_BUG( "unknown pattern mode %d", pattern_mode );
}
}
示例9: ep9x_set_destination
static inline void
ep9x_set_destination( EP9XDriverData *ep9xdrv,
EP9XDeviceData *ep9xdev,
CardState *state )
{
CoreSurfaceBuffer *buffer = state->dst.buffer;
if (ep9xdev->smf_destination)
return;
ep9xdev->destaddr = state->dst.offset;
ep9xdev->destpitch = state->dst.pitch;
switch (buffer->format) {
case DSPF_RGB16:
ep9xdev->pixeldepth = 2;
ep9xdev->pixelformat = DSPF_RGB16;
break;
case DSPF_RGB24:
ep9xdev->pixeldepth = 3;
ep9xdev->pixelformat = DSPF_RGB24;
break;
case DSPF_RGB32:
ep9xdev->pixeldepth = 3;
ep9xdev->pixelformat = DSPF_RGB32;
break;
default:
D_BUG("unexpected pixelformat~");
}
ep9xdev->smf_destination = 1;
}
示例10: i810_wait_for_space
static inline int
i810_wait_for_space(I810DriverData *i810drv,
I810DeviceData *i810dev,
u32 space )
{
u32 head, count = TIMER_LOOP, tail, tries = 0;
i810dev->waitfifo_calls++;
tail = i810dev->cur_tail;
space += BUFFER_PADDING;
space <<= 2;
i810dev->waitfifo_sum += space;
while (count--) {
i810dev->fifo_waitcycles++;
head = i810_readl(i810drv->mmio_base, LRING + 4) & RBUFFER_HEAD_MASK;
if ((tail == head) ||
(tail > head && (RINGBUFFER_SIZE - tail + head) >= space) ||
(tail < head && (head - tail) >= space)) {
if (!tries)
i810dev->fifo_cache_hits++;
return 0;
}
tries++;
}
D_BUG("warning: buffer space timout error");
return 1;
}
示例11: fusion_ref_watch
DirectResult
fusion_ref_watch (FusionRef *ref, FusionCall *call, int call_arg)
{
DirectResult ret;
D_ASSERT( ref != NULL );
D_ASSERT( call != NULL );
ret = fusion_skirmish_prevail( &ref->multi.builtin.lock );
if (ret)
return ret;
if (ref->multi.builtin.local+ref->multi.builtin.global == 0) {
D_BUG( "ref has no references" );
ret = DR_BUG;
}
else if (ref->multi.builtin.call) {
ret = DR_BUSY;
}
else {
ref->multi.builtin.call = call;
ref->multi.builtin.call_arg = call_arg;
fusion_skirmish_notify( &ref->multi.builtin.lock );
}
fusion_skirmish_dismiss( &ref->multi.builtin.lock );
return ret;
}
示例12: fusion_hash_insert
/**
* fusion_hash_insert:
* @hash: a #FusionHash.
* @key: a key to insert.
* @value: the value to associate with the key.
*
* Inserts a new key and value into a #FusionHash.
* If the key already exists in the #FusionHash DFB_BUG is returned
* If you think a key may exist you should call fusion_hash_replace
* Generally this is only used on a new FusionHash
**/
DirectResult
fusion_hash_insert( FusionHash *hash,
void *key,
void *value )
{
FusionHashNode **node;
D_MAGIC_ASSERT( hash, FusionHash );
node = fusion_hash_lookup_node (hash, key);
if (*node) {
D_BUG( "key already exists" );
return DFB_BUG;
}
else {
if (hash->local)
(*node) = D_CALLOC(1,sizeof(FusionHashNode));
else
(*node) = SHCALLOC(hash->pool, 1, sizeof(FusionHashNode));
if ( !(*node) )
return hash->local?DFB_NOSYSTEMMEMORY:DFB_NOSHAREDMEMORY;
(*node)->key = key;
(*node)->value = value;
hash->nnodes++;
if ( fusion_hash_should_resize(hash) )
fusion_hash_resize(hash);
}
return DFB_OK;
}
示例13: mach64_set_destination
void mach64_set_destination( Mach64DriverData *mdrv,
Mach64DeviceData *mdev,
CardState *state )
{
volatile u8 *mmio = mdrv->mmio_base;
CoreSurface *destination = state->destination;
unsigned int pitch = state->dst.pitch / DFB_BYTES_PER_PIXEL( destination->config.format );
mdev->pix_width &= ~DST_PIX_WIDTH;
switch (destination->config.format) {
case DSPF_RGB332:
mdev->pix_width |= DST_PIX_WIDTH_8BPP;
break;
case DSPF_RGB555:
case DSPF_ARGB1555:
mdev->pix_width |= DST_PIX_WIDTH_15BPP;
break;
case DSPF_RGB16:
mdev->pix_width |= DST_PIX_WIDTH_16BPP;
break;
case DSPF_RGB32:
case DSPF_ARGB:
mdev->pix_width |= DST_PIX_WIDTH_32BPP;
break;
default:
D_BUG( "unexpected pixelformat!" );
return;
}
mach64_waitfifo( mdrv, mdev, 1 );
mach64_out32( mmio, DST_OFF_PITCH, (state->dst.offset/8) | ((pitch/8) << 22) );
}
示例14: CoreInputHubClient_Dispatch
static void
CoreInputHubClient_Dispatch( void *context,
const OnePacketHeader *header,
void *data,
OneThread *thread )
{
CoreInputHubClient *client = context;
const InputHubNotification *notification = data;
D_DEBUG_AT( Core_InputHub, "%s()\n", __FUNCTION__ );
switch (notification->type) {
case IHNT_DEVICE_ADD:
CoreInputHubClient_Dispatch_DeviceAdd( client, notification );
break;
case IHNT_DEVICE_REMOVE:
CoreInputHubClient_Dispatch_DeviceRemove( client, notification );
break;
case IHNT_EVENT_DISPATCH:
CoreInputHubClient_Dispatch_EventDispatch( client, notification );
break;
default:
D_BUG( "unknown notification type %d", notification->type );
}
}
示例15: pvr2d_validate_DESTINATION
/*
* Called by pvr2dSetState() to ensure that the destination parameters are
* properly set for execution of rendering functions. gdev->prog_index
* must be valid.
*/
static inline void
pvr2d_validate_DESTINATION(PVR2DDriverData *gdrv,
PVR2DDeviceData *gdev,
CardState *state)
{
D_DEBUG_AT(PVR2D__2D, "%s( format 0x%08x )\n", __FUNCTION__, state->destination->config.format);
gdrv->bltinfo.pDstMemInfo = state->dst.handle;
gdrv->bltinfo.DstOffset = 0;
gdrv->bltinfo.DstStride = state->dst.pitch;
gdrv->bltinfo.DstSurfWidth = state->destination->config.size.w;
gdrv->bltinfo.DstSurfHeight = state->destination->config.size.h;
switch (state->destination->config.format) {
case DSPF_ARGB:
case DSPF_RGB32:
gdrv->bltinfo.DstFormat = PVR2D_ARGB8888;
break;
case DSPF_RGB16:
gdrv->bltinfo.DstFormat = PVR2D_RGB565;
break;
default:
D_BUG( "unexpected pixelformat %d", state->destination->config.format );
}
// Set the flag.
PVR2D_VALIDATE(DESTINATION);
}